From 3d3f588690f83b106f4c3decb94b583098a32e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwanyongkang=E2=80=9D?= <“937888580@qq.com”> Date: Thu, 29 Feb 2024 10:30:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=83=E7=89=9B=E4=BA=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/adbario/php-dot-notation/LICENSE.md | 21 - vendor/adbario/php-dot-notation/composer.json | 29 - vendor/adbario/php-dot-notation/src/Dot.php | 601 ------- .../adbario/php-dot-notation/src/helpers.php | 23 - vendor/alibabacloud/credentials/CHANGELOG.md | 14 - .../alibabacloud/credentials/CONTRIBUTING.md | 30 - vendor/alibabacloud/credentials/LICENSE.md | 13 - vendor/alibabacloud/credentials/NOTICE.md | 88 - .../alibabacloud/credentials/README-zh-CN.md | 250 --- vendor/alibabacloud/credentials/README.md | 251 --- vendor/alibabacloud/credentials/SECURITY.md | 21 - vendor/alibabacloud/credentials/UPGRADING.md | 6 - vendor/alibabacloud/credentials/composer.json | 104 -- .../credentials/src/AccessKeyCredential.php | 72 - .../credentials/src/BearerTokenCredential.php | 53 - .../credentials/src/Credential.php | 182 -- .../credentials/src/Credential/Config.php | 50 - .../credentials/src/Credentials.php | 102 -- .../credentials/src/CredentialsInterface.php | 23 - .../credentials/src/EcsRamRoleCredential.php | 151 -- .../alibabacloud/credentials/src/Filter.php | 134 -- .../alibabacloud/credentials/src/Helper.php | 202 --- .../credentials/src/MockTrait.php | 98 -- .../src/Providers/ChainProvider.php | 187 --- .../src/Providers/EcsRamRoleProvider.php | 94 -- .../credentials/src/Providers/Provider.php | 82 - .../src/Providers/RamRoleArnProvider.php | 49 - .../src/Providers/RsaKeyPairProvider.php | 53 - .../credentials/src/RamRoleArnCredential.php | 218 --- .../credentials/src/Request/AssumeRole.php | 37 - .../src/Request/GenerateSessionAccessKey.php | 33 - .../credentials/src/Request/Request.php | 155 -- .../credentials/src/RsaKeyPairCredential.php | 158 -- .../src/Signature/BearerTokenSignature.php | 47 - .../src/Signature/ShaHmac1Signature.php | 47 - .../src/Signature/ShaHmac256Signature.php | 47 - .../Signature/ShaHmac256WithRsaSignature.php | 64 - .../src/Signature/SignatureInterface.php | 34 - .../credentials/src/StsCredential.php | 98 -- .../alibabacloud/darabonba-openapi/.gitignore | 15 - .../darabonba-openapi/.php_cs.dist | 65 - .../darabonba-openapi/README-CN.md | 31 - .../alibabacloud/darabonba-openapi/README.md | 31 - .../darabonba-openapi/autoload.php | 15 - .../darabonba-openapi/composer.json | 32 - .../darabonba-openapi/src/Models/Config.php | 387 ----- .../src/Models/OpenApiRequest.php | 65 - .../darabonba-openapi/src/Models/Params.php | 137 -- .../darabonba-openapi/src/OpenApiClient.php | 943 ----------- .../alibabacloud/dysmsapi-20170525/.gitignore | 15 - .../dysmsapi-20170525/.php_cs.dist | 65 - .../dysmsapi-20170525/ChangeLog.md | 21 - .../dysmsapi-20170525/README-CN.md | 35 - .../alibabacloud/dysmsapi-20170525/README.md | 35 - .../dysmsapi-20170525/autoload.php | 17 - .../dysmsapi-20170525/composer.json | 33 - .../dysmsapi-20170525/src/Dysmsapi.php | 1119 ------------- .../src/Models/AddShortUrlRequest.php | 107 -- .../src/Models/AddShortUrlResponse.php | 61 - .../src/Models/AddShortUrlResponseBody.php | 84 - .../Models/AddShortUrlResponseBody/data.php | 71 - .../src/Models/AddSmsSignRequest.php | 132 -- .../Models/AddSmsSignRequest/signFileList.php | 59 - .../src/Models/AddSmsSignResponse.php | 61 - .../src/Models/AddSmsSignResponseBody.php | 83 - .../src/Models/AddSmsTemplateRequest.php | 119 -- .../src/Models/AddSmsTemplateResponse.php | 61 - .../src/Models/AddSmsTemplateResponseBody.php | 83 - .../Models/CreateCardSmsTemplateRequest.php | 71 - .../Models/CreateCardSmsTemplateResponse.php | 61 - .../CreateCardSmsTemplateResponseBody.php | 84 - .../data.php | 47 - .../CreateCardSmsTemplateShrinkRequest.php | 71 - .../src/Models/DeleteShortUrlRequest.php | 83 - .../src/Models/DeleteShortUrlResponse.php | 61 - .../src/Models/DeleteShortUrlResponseBody.php | 71 - .../src/Models/DeleteSmsSignRequest.php | 83 - .../src/Models/DeleteSmsSignResponse.php | 61 - .../src/Models/DeleteSmsSignResponseBody.php | 83 - .../src/Models/DeleteSmsTemplateRequest.php | 83 - .../src/Models/DeleteSmsTemplateResponse.php | 61 - .../Models/DeleteSmsTemplateResponseBody.php | 83 - .../src/Models/GetMediaResourceIdRequest.php | 95 -- .../src/Models/GetMediaResourceIdResponse.php | 61 - .../Models/GetMediaResourceIdResponseBody.php | 84 - .../GetMediaResourceIdResponseBody/data.php | 47 - .../GetOSSInfoForCardTemplateResponse.php | 61 - .../GetOSSInfoForCardTemplateResponseBody.php | 84 - .../data.php | 107 -- .../src/Models/ListTagResourcesRequest.php | 170 -- .../Models/ListTagResourcesRequest/tag.php | 59 - .../src/Models/ListTagResourcesResponse.php | 61 - .../Models/ListTagResourcesResponseBody.php | 84 - .../tagResources.php | 60 - .../tagResources/tagResource.php | 83 - .../src/Models/ModifySmsSignRequest.php | 132 -- .../ModifySmsSignRequest/signFileList.php | 59 - .../src/Models/ModifySmsSignResponse.php | 61 - .../src/Models/ModifySmsSignResponseBody.php | 83 - .../src/Models/ModifySmsTemplateRequest.php | 131 -- .../src/Models/ModifySmsTemplateResponse.php | 61 - .../Models/ModifySmsTemplateResponseBody.php | 83 - .../Models/QueryCardSmsTemplateRequest.php | 47 - .../Models/QueryCardSmsTemplateResponse.php | 61 - .../QueryCardSmsTemplateResponseBody.php | 84 - .../QueryCardSmsTemplateResponseBody/data.php | 49 - .../src/Models/QuerySendDetailsRequest.php | 131 -- .../src/Models/QuerySendDetailsResponse.php | 61 - .../Models/QuerySendDetailsResponseBody.php | 96 -- .../smsSendDetailDTOs.php | 60 - .../smsSendDetailDTOs/smsSendDetailDTO.php | 131 -- .../src/Models/QueryShortUrlRequest.php | 83 - .../src/Models/QueryShortUrlResponse.php | 61 - .../src/Models/QueryShortUrlResponseBody.php | 84 - .../Models/QueryShortUrlResponseBody/data.php | 131 -- .../src/Models/QuerySmsSignRequest.php | 83 - .../src/Models/QuerySmsSignResponse.php | 61 - .../src/Models/QuerySmsSignResponseBody.php | 119 -- .../src/Models/QuerySmsTemplateRequest.php | 83 - .../src/Models/QuerySmsTemplateResponse.php | 61 - .../Models/QuerySmsTemplateResponseBody.php | 155 -- .../src/Models/SendBatchSmsRequest.php | 131 -- .../src/Models/SendBatchSmsResponse.php | 61 - .../src/Models/SendBatchSmsResponseBody.php | 83 - .../src/Models/SendCardSmsRequest.php | 168 -- .../Models/SendCardSmsRequest/cardObjects.php | 71 - .../src/Models/SendCardSmsResponse.php | 61 - .../src/Models/SendCardSmsResponseBody.php | 84 - .../Models/SendCardSmsResponseBody/data.php | 107 -- .../src/Models/SendSmsRequest.php | 143 -- .../src/Models/SendSmsResponse.php | 61 - .../src/Models/SendSmsResponseBody.php | 83 - .../src/Models/TagResourcesRequest.php | 146 -- .../src/Models/TagResourcesRequest/tag.php | 59 - .../src/Models/TagResourcesResponse.php | 61 - .../src/Models/TagResourcesResponseBody.php | 71 - .../src/Models/UntagResourcesRequest.php | 147 -- .../src/Models/UntagResourcesResponse.php | 61 - .../src/Models/UntagResourcesResponseBody.php | 71 - vendor/alibabacloud/endpoint-util/.gitignore | 13 - .../alibabacloud/endpoint-util/.php_cs.dist | 65 - vendor/alibabacloud/endpoint-util/LICENSE | 13 - .../alibabacloud/endpoint-util/README-CN.md | 31 - vendor/alibabacloud/endpoint-util/README.md | 31 - .../alibabacloud/endpoint-util/composer.json | 42 - vendor/alibabacloud/endpoint-util/phpunit.xml | 32 - .../endpoint-util/src/Endpoint.php | 61 - .../endpoint-util/tests/EndpointTest.php | 58 - .../endpoint-util/tests/bootstrap.php | 3 - vendor/alibabacloud/openapi-util/.gitignore | 15 - vendor/alibabacloud/openapi-util/.php_cs.dist | 65 - vendor/alibabacloud/openapi-util/README-CN.md | 31 - vendor/alibabacloud/openapi-util/README.md | 31 - vendor/alibabacloud/openapi-util/autoload.php | 17 - .../alibabacloud/openapi-util/composer.json | 45 - vendor/alibabacloud/openapi-util/phpunit.xml | 31 - .../openapi-util/src/OpenApiUtilClient.php | 542 ------ .../tests/OpenApiUtilClientTest.php | 359 ---- .../openapi-util/tests/bootstrap.php | 3 - vendor/alibabacloud/tea-utils/.gitignore | 3 - vendor/alibabacloud/tea-utils/.php_cs.dist | 65 - vendor/alibabacloud/tea-utils/README-CN.md | 31 - vendor/alibabacloud/tea-utils/README.md | 31 - vendor/alibabacloud/tea-utils/composer.json | 38 - vendor/alibabacloud/tea-utils/phpunit.xml | 15 - vendor/alibabacloud/tea-utils/src/Utils.php | 560 ------- .../tea-utils/src/Utils/RuntimeOptions.php | 39 - .../tea-utils/tests/UtilsTest.php | 435 ----- .../tea-utils/tests/bootstrap.php | 3 - vendor/alibabacloud/tea/.php_cs.dist | 65 - vendor/alibabacloud/tea/CHANGELOG.md | 148 -- vendor/alibabacloud/tea/LICENSE.md | 13 - vendor/alibabacloud/tea/README.md | 16 - vendor/alibabacloud/tea/composer.json | 80 - .../tea/src/Exception/TeaError.php | 47 - .../tea/src/Exception/TeaRetryError.php | 21 - .../tea/src/Exception/TeaUnableRetryError.php | 41 - vendor/alibabacloud/tea/src/Helper.php | 68 - vendor/alibabacloud/tea/src/Model.php | 114 -- vendor/alibabacloud/tea/src/Parameter.php | 49 - vendor/alibabacloud/tea/src/Request.php | 119 -- vendor/alibabacloud/tea/src/Response.php | 366 ---- vendor/alibabacloud/tea/src/Tea.php | 281 ---- vendor/composer/InstalledVersions.php | 184 +- vendor/composer/autoload_classmap.php | 1 + vendor/composer/autoload_files.php | 7 +- vendor/composer/autoload_psr4.php | 16 +- vendor/composer/autoload_static.php | 94 +- vendor/composer/installed.json | 1181 ++----------- vendor/composer/installed.php | 184 +- vendor/composer/platform_check.php | 4 +- vendor/guzzlehttp/guzzle/CHANGELOG.md | 1479 ----------------- 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 | 576 ------- .../src/Handler/CurlFactoryInterface.php | 25 - .../guzzle/src/Handler/CurlHandler.php | 49 - .../guzzle/src/Handler/CurlMultiHandler.php | 257 --- .../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-bin/php-cs-fixer/composer.json | 9 - .../guzzle/vendor-bin/phpstan/composer.json | 10 - .../guzzle/vendor-bin/psalm/composer.json | 9 - 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 - vendor/lizhichao/one-sm/.github/FUNDING.yml | 5 - .../lizhichao/one-sm/.github/workflows/sm.yml | 33 - vendor/lizhichao/one-sm/.gitignore | 7 - vendor/lizhichao/one-sm/.php_cs.dist | 65 - vendor/lizhichao/one-sm/README.md | 100 -- vendor/lizhichao/one-sm/bench.php | 97 -- vendor/lizhichao/one-sm/composer.json | 24 - vendor/lizhichao/one-sm/src/Sm3.php | 142 -- vendor/lizhichao/one-sm/src/Sm4.php | 350 ---- vendor/lizhichao/one-sm/test.php | 3 - vendor/lizhichao/one-sm/tests/sm3.php | 41 - vendor/lizhichao/one-sm/tests/sm4.php | 79 - vendor/myclabs/php-enum/LICENSE | 18 + vendor/myclabs/php-enum/README.md | 194 +++ vendor/myclabs/php-enum/SECURITY.md | 11 + vendor/myclabs/php-enum/composer.json | 36 + vendor/myclabs/php-enum/src/Enum.php | 318 ++++ .../php-enum/src/PHPUnit/Comparator.php | 54 + vendor/myclabs/php-enum/stubs/Stringable.php | 11 + 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 ---- .../php-sdk/.github/workflows/test-ci.yml | 71 + vendor/qiniu/php-sdk/.gitignore | 12 + vendor/qiniu/php-sdk/.scrutinizer.yml | 42 + vendor/qiniu/php-sdk/CHANGELOG.md | 185 +++ vendor/qiniu/php-sdk/CONTRIBUTING.md | 30 + .../getallheaders => qiniu/php-sdk}/LICENSE | 3 +- vendor/qiniu/php-sdk/README.md | 76 + vendor/qiniu/php-sdk/autoload.php | 19 + vendor/qiniu/php-sdk/codecov.yml | 28 + vendor/qiniu/php-sdk/composer.json | 38 + vendor/qiniu/php-sdk/examples/README.md | 10 + .../php-sdk/examples/bucket_lifecycleRule.php | 42 + .../php-sdk/examples/cdn_get_bandwidth.php | 41 + .../qiniu/php-sdk/examples/cdn_get_flux.php | 35 + .../php-sdk/examples/cdn_get_log_list.php | 31 + .../examples/cdn_get_prefetch_list.php | 46 + .../php-sdk/examples/cdn_get_refresh_list.php | 48 + .../examples/cdn_refresh_urls_dirs.php | 59 + .../examples/cdn_timestamp_antileech.php | 20 + .../qiniu/php-sdk/examples/censor_image.php | 42 + .../qiniu/php-sdk/examples/censor_video.php | 52 + .../qiniu/php-sdk/examples/delete_bucket.php | 27 + .../php-sdk/examples/delete_bucketEvent.php | 28 + .../examples/delete_bucketLifecycleRule.php | 27 + .../php-sdk/examples/get_bucketEvents.php | 26 + .../examples/get_bucketLifecycleRules.php | 26 + .../qiniu/php-sdk/examples/get_bucketList.php | 26 + .../php-sdk/examples/get_bucketQuota.php | 26 + .../qiniu/php-sdk/examples/get_bucketinfo.php | 25 + .../php-sdk/examples/get_bucketinfos.php | 26 + .../qiniu/php-sdk/examples/get_corsRules.php | 26 + .../php-sdk/examples/image_url_builder.php | 74 + .../php-sdk/examples/persistent_fop_init.php | 18 + .../examples/persistent_fop_status.php | 19 + vendor/qiniu/php-sdk/examples/pfop_mkzip.php | 58 + vendor/qiniu/php-sdk/examples/pfop_vframe.php | 55 + .../php-sdk/examples/pfop_video_avthumb.php | 55 + .../qiniu/php-sdk/examples/pfop_watermark.php | 59 + vendor/qiniu/php-sdk/examples/php-logo.png | Bin 0 -> 65062 bytes vendor/qiniu/php-sdk/examples/prefop.php | 27 + .../php-sdk/examples/put_bucketAccessMode.php | 27 + .../examples/put_bucketAccessStyleMode.php | 27 + .../php-sdk/examples/put_bucketEvent.php | 32 + .../php-sdk/examples/put_bucketMaxAge.php | 27 + .../php-sdk/examples/put_bucketQuota.php | 29 + .../php-sdk/examples/put_referAntiLeech.php | 30 + vendor/qiniu/php-sdk/examples/qetag.php | 14 + .../php-sdk/examples/rs_asynch_fetch.php | 71 + .../php-sdk/examples/rs_batch_change_mime.php | 32 + .../php-sdk/examples/rs_batch_change_type.php | 45 + .../qiniu/php-sdk/examples/rs_batch_copy.php | 40 + .../php-sdk/examples/rs_batch_delete.php | 32 + .../examples/rs_batch_delete_after_days.php | 39 + .../qiniu/php-sdk/examples/rs_batch_move.php | 40 + .../php-sdk/examples/rs_batch_restore_ar.php | 41 + .../qiniu/php-sdk/examples/rs_batch_stat.php | 32 + .../php-sdk/examples/rs_bucket_domains.php | 26 + vendor/qiniu/php-sdk/examples/rs_buckets.php | 25 + .../qiniu/php-sdk/examples/rs_change_mime.php | 29 + .../php-sdk/examples/rs_change_status.php | 29 + .../qiniu/php-sdk/examples/rs_change_type.php | 36 + vendor/qiniu/php-sdk/examples/rs_copy.php | 33 + vendor/qiniu/php-sdk/examples/rs_delete.php | 27 + .../php-sdk/examples/rs_delete_after_days.php | 26 + .../php-sdk/examples/rs_download_urls.php | 19 + vendor/qiniu/php-sdk/examples/rs_fetch.php | 43 + vendor/qiniu/php-sdk/examples/rs_move.php | 29 + vendor/qiniu/php-sdk/examples/rs_prefetch.php | 25 + vendor/qiniu/php-sdk/examples/rs_restore.php | 28 + vendor/qiniu/php-sdk/examples/rs_stat.php | 28 + .../php-sdk/examples/rsf_list_bucket.php | 47 + .../qiniu/php-sdk/examples/rsf_list_files.php | 39 + .../php-sdk/examples/rsf_v2list_bucket.php | 34 + vendor/qiniu/php-sdk/examples/rtc/README.md | 34 + .../php-sdk/examples/rtc/rtc_createApp.php | 32 + .../examples/rtc/rtc_create_roomToken.php | 34 + .../php-sdk/examples/rtc/rtc_deleteApp.php | 25 + .../qiniu/php-sdk/examples/rtc/rtc_getApp.php | 26 + .../examples/rtc/rtc_rooms_kickUser.php | 31 + .../rtc/rtc_rooms_listActiveRooms.php | 35 + .../examples/rtc/rtc_rooms_listUser.php | 29 + .../examples/rtc/rtc_rooms_stopMerge.php | 28 + .../php-sdk/examples/rtc/rtc_updateApp.php | 40 + vendor/qiniu/php-sdk/examples/saveas.php | 33 + vendor/qiniu/php-sdk/examples/sms/README.md | 45 + .../examples/sms/sms_create_signature.php | 29 + .../examples/sms/sms_create_template.php | 33 + .../examples/sms/sms_delete_signature.php | 25 + .../examples/sms/sms_delete_template.php | 25 + .../examples/sms/sms_edit_signature.php | 30 + .../examples/sms/sms_edit_template.php | 31 + .../examples/sms/sms_query_send_sms.php | 50 + .../examples/sms/sms_query_signature.php | 28 + .../sms/sms_query_single_signature.php | 26 + .../sms/sms_query_single_template.php | 26 + .../examples/sms/sms_query_template.php | 28 + .../php-sdk/examples/sms/sms_send_message.php | 32 + .../php-sdk/examples/update_bucketEvent.php | 31 + .../examples/update_bucketLifecycleRule.php | 36 + .../php-sdk/examples/upload_and_callback.php | 31 + .../php-sdk/examples/upload_and_pfop.php | 49 + .../php-sdk/examples/upload_mgr_init.php | 19 + .../php-sdk/examples/upload_multi_demos.php | 89 + .../php-sdk/examples/upload_simple_file.php | 37 + .../qiniu/php-sdk/examples/upload_tokens.php | 82 + .../examples/upload_verify_callback.php | 34 + .../php-sdk/examples/upload_with_qvmzone.php | 40 + .../php-sdk/examples/upload_with_zone.php | 39 + vendor/qiniu/php-sdk/phpunit.xml.dist | 18 + vendor/qiniu/php-sdk/src/Qiniu/Auth.php | 255 +++ .../php-sdk/src/Qiniu/Cdn/CdnManager.php | 263 +++ vendor/qiniu/php-sdk/src/Qiniu/Config.php | 398 +++++ .../php-sdk/src/Qiniu/Enum/QiniuEnum.php | 53 + .../src/Qiniu/Enum/SplitUploadVersion.php | 9 + vendor/qiniu/php-sdk/src/Qiniu/Etag.php | 76 + .../qiniu/php-sdk/src/Qiniu/Http/Client.php | 198 +++ vendor/qiniu/php-sdk/src/Qiniu/Http/Error.php | 38 + .../qiniu/php-sdk/src/Qiniu/Http/Header.php | 281 ++++ .../src/Qiniu/Http/Middleware/Middleware.php | 31 + .../Middleware/RetryDomainsMiddleware.php | 76 + vendor/qiniu/php-sdk/src/Qiniu/Http/Proxy.php | 34 + .../qiniu/php-sdk/src/Qiniu/Http/Request.php | 42 + .../php-sdk/src/Qiniu/Http/RequestOptions.php | 104 ++ .../qiniu/php-sdk/src/Qiniu/Http/Response.php | 220 +++ .../src/Qiniu/Processing/ImageUrlBuilder.php | 292 ++++ .../src/Qiniu/Processing/Operation.php | 69 + .../src/Qiniu/Processing/PersistentFop.php | 101 ++ vendor/qiniu/php-sdk/src/Qiniu/Region.php | 229 +++ .../qiniu/php-sdk/src/Qiniu/Rtc/AppClient.php | 236 +++ vendor/qiniu/php-sdk/src/Qiniu/Sms/Sms.php | 382 +++++ .../src/Qiniu/Storage/ArgusManager.php | 131 ++ .../src/Qiniu/Storage/BucketManager.php | 1324 +++++++++++++++ .../src/Qiniu/Storage/FormUploader.php | 165 ++ .../src/Qiniu/Storage/ResumeUploader.php | 580 +++++++ .../src/Qiniu/Storage/UploadManager.php | 176 ++ vendor/qiniu/php-sdk/src/Qiniu/Zone.php | 58 + vendor/qiniu/php-sdk/src/Qiniu/functions.php | 346 ++++ vendor/qiniu/php-sdk/test-env.sh | 4 + .../php-sdk/tests/Qiniu/Tests/AuthTest.php | 240 +++ .../php-sdk/tests/Qiniu/Tests/Base64Test.php | 16 + .../php-sdk/tests/Qiniu/Tests/BucketTest.php | 733 ++++++++ .../tests/Qiniu/Tests/CdnManagerTest.php | 151 ++ .../php-sdk/tests/Qiniu/Tests/ConfigTest.php | 118 ++ .../php-sdk/tests/Qiniu/Tests/Crc32Test.php | 23 + .../tests/Qiniu/Tests/DownloadTest.php | 27 + .../php-sdk/tests/Qiniu/Tests/EntryTest.php | 88 + .../php-sdk/tests/Qiniu/Tests/EtagTest.php | 54 + .../php-sdk/tests/Qiniu/Tests/FopTest.php | 39 + .../php-sdk/tests/Qiniu/Tests/FormUpTest.php | 205 +++ .../php-sdk/tests/Qiniu/Tests/HeaderTest.php | 184 ++ .../php-sdk/tests/Qiniu/Tests/HttpTest.php | 163 ++ .../tests/Qiniu/Tests/ImageUrlBuilderTest.php | 263 +++ .../tests/Qiniu/Tests/MiddlewareTest.php | 160 ++ .../php-sdk/tests/Qiniu/Tests/PfopTest.php | 68 + .../tests/Qiniu/Tests/ResumeUpTest.php | 354 ++++ .../php-sdk/tests/Qiniu/Tests/ZoneTest.php | 136 ++ vendor/qiniu/php-sdk/tests/bootstrap.php | 61 + vendor/qiniu/php-sdk/tests/mock-server/ok.php | 3 + .../php-sdk/tests/mock-server/redirect.php | 5 + .../php-sdk/tests/mock-server/timeout.php | 3 + .../qiniu/php-sdk/tests/socks5-server/go.mod | 7 + .../qiniu/php-sdk/tests/socks5-server/go.sum | 4 + .../qiniu/php-sdk/tests/socks5-server/main.go | 24 + 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 - 521 files changed, 13990 insertions(+), 41150 deletions(-) delete mode 100644 vendor/adbario/php-dot-notation/LICENSE.md delete mode 100644 vendor/adbario/php-dot-notation/composer.json delete mode 100644 vendor/adbario/php-dot-notation/src/Dot.php delete mode 100644 vendor/adbario/php-dot-notation/src/helpers.php delete mode 100644 vendor/alibabacloud/credentials/CHANGELOG.md delete mode 100644 vendor/alibabacloud/credentials/CONTRIBUTING.md delete mode 100644 vendor/alibabacloud/credentials/LICENSE.md delete mode 100644 vendor/alibabacloud/credentials/NOTICE.md delete mode 100644 vendor/alibabacloud/credentials/README-zh-CN.md delete mode 100644 vendor/alibabacloud/credentials/README.md delete mode 100644 vendor/alibabacloud/credentials/SECURITY.md delete mode 100644 vendor/alibabacloud/credentials/UPGRADING.md delete mode 100644 vendor/alibabacloud/credentials/composer.json delete mode 100644 vendor/alibabacloud/credentials/src/AccessKeyCredential.php delete mode 100644 vendor/alibabacloud/credentials/src/BearerTokenCredential.php delete mode 100644 vendor/alibabacloud/credentials/src/Credential.php delete mode 100644 vendor/alibabacloud/credentials/src/Credential/Config.php delete mode 100644 vendor/alibabacloud/credentials/src/Credentials.php delete mode 100644 vendor/alibabacloud/credentials/src/CredentialsInterface.php delete mode 100644 vendor/alibabacloud/credentials/src/EcsRamRoleCredential.php delete mode 100644 vendor/alibabacloud/credentials/src/Filter.php delete mode 100644 vendor/alibabacloud/credentials/src/Helper.php delete mode 100644 vendor/alibabacloud/credentials/src/MockTrait.php delete mode 100644 vendor/alibabacloud/credentials/src/Providers/ChainProvider.php delete mode 100644 vendor/alibabacloud/credentials/src/Providers/EcsRamRoleProvider.php delete mode 100644 vendor/alibabacloud/credentials/src/Providers/Provider.php delete mode 100644 vendor/alibabacloud/credentials/src/Providers/RamRoleArnProvider.php delete mode 100644 vendor/alibabacloud/credentials/src/Providers/RsaKeyPairProvider.php delete mode 100644 vendor/alibabacloud/credentials/src/RamRoleArnCredential.php delete mode 100644 vendor/alibabacloud/credentials/src/Request/AssumeRole.php delete mode 100644 vendor/alibabacloud/credentials/src/Request/GenerateSessionAccessKey.php delete mode 100644 vendor/alibabacloud/credentials/src/Request/Request.php delete mode 100644 vendor/alibabacloud/credentials/src/RsaKeyPairCredential.php delete mode 100644 vendor/alibabacloud/credentials/src/Signature/BearerTokenSignature.php delete mode 100644 vendor/alibabacloud/credentials/src/Signature/ShaHmac1Signature.php delete mode 100644 vendor/alibabacloud/credentials/src/Signature/ShaHmac256Signature.php delete mode 100644 vendor/alibabacloud/credentials/src/Signature/ShaHmac256WithRsaSignature.php delete mode 100644 vendor/alibabacloud/credentials/src/Signature/SignatureInterface.php delete mode 100644 vendor/alibabacloud/credentials/src/StsCredential.php delete mode 100644 vendor/alibabacloud/darabonba-openapi/.gitignore delete mode 100644 vendor/alibabacloud/darabonba-openapi/.php_cs.dist delete mode 100644 vendor/alibabacloud/darabonba-openapi/README-CN.md delete mode 100644 vendor/alibabacloud/darabonba-openapi/README.md delete mode 100644 vendor/alibabacloud/darabonba-openapi/autoload.php delete mode 100644 vendor/alibabacloud/darabonba-openapi/composer.json delete mode 100644 vendor/alibabacloud/darabonba-openapi/src/Models/Config.php delete mode 100644 vendor/alibabacloud/darabonba-openapi/src/Models/OpenApiRequest.php delete mode 100644 vendor/alibabacloud/darabonba-openapi/src/Models/Params.php delete mode 100644 vendor/alibabacloud/darabonba-openapi/src/OpenApiClient.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/.gitignore delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/.php_cs.dist delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/ChangeLog.md delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/README-CN.md delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/README.md delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/autoload.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/composer.json delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Dysmsapi.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/AddShortUrlRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/AddShortUrlResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/AddShortUrlResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/AddShortUrlResponseBody/data.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsSignRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsSignRequest/signFileList.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsSignResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsSignResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsTemplateRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsTemplateResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsTemplateResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateResponseBody/data.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateShrinkRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteShortUrlRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteShortUrlResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteShortUrlResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsSignRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsSignResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsSignResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsTemplateRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsTemplateResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsTemplateResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/GetMediaResourceIdRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/GetMediaResourceIdResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/GetMediaResourceIdResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/GetMediaResourceIdResponseBody/data.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/GetOSSInfoForCardTemplateResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/GetOSSInfoForCardTemplateResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/GetOSSInfoForCardTemplateResponseBody/data.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesRequest/tag.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesResponseBody/tagResources.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesResponseBody/tagResources/tagResource.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsSignRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsSignRequest/signFileList.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsSignResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsSignResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsTemplateRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsTemplateResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsTemplateResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryCardSmsTemplateRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryCardSmsTemplateResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryCardSmsTemplateResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryCardSmsTemplateResponseBody/data.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsResponseBody/smsSendDetailDTOs.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsResponseBody/smsSendDetailDTOs/smsSendDetailDTO.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryShortUrlRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryShortUrlResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryShortUrlResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryShortUrlResponseBody/data.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsSignRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsSignResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsSignResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsTemplateRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsTemplateResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsTemplateResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/SendBatchSmsRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/SendBatchSmsResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/SendBatchSmsResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsRequest/cardObjects.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsResponseBody/data.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/SendSmsRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/SendSmsResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/SendSmsResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/TagResourcesRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/TagResourcesRequest/tag.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/TagResourcesResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/TagResourcesResponseBody.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/UntagResourcesRequest.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/UntagResourcesResponse.php delete mode 100644 vendor/alibabacloud/dysmsapi-20170525/src/Models/UntagResourcesResponseBody.php delete mode 100644 vendor/alibabacloud/endpoint-util/.gitignore delete mode 100644 vendor/alibabacloud/endpoint-util/.php_cs.dist delete mode 100644 vendor/alibabacloud/endpoint-util/LICENSE delete mode 100644 vendor/alibabacloud/endpoint-util/README-CN.md delete mode 100644 vendor/alibabacloud/endpoint-util/README.md delete mode 100644 vendor/alibabacloud/endpoint-util/composer.json delete mode 100644 vendor/alibabacloud/endpoint-util/phpunit.xml delete mode 100644 vendor/alibabacloud/endpoint-util/src/Endpoint.php delete mode 100644 vendor/alibabacloud/endpoint-util/tests/EndpointTest.php delete mode 100644 vendor/alibabacloud/endpoint-util/tests/bootstrap.php delete mode 100644 vendor/alibabacloud/openapi-util/.gitignore delete mode 100644 vendor/alibabacloud/openapi-util/.php_cs.dist delete mode 100644 vendor/alibabacloud/openapi-util/README-CN.md delete mode 100644 vendor/alibabacloud/openapi-util/README.md delete mode 100644 vendor/alibabacloud/openapi-util/autoload.php delete mode 100644 vendor/alibabacloud/openapi-util/composer.json delete mode 100644 vendor/alibabacloud/openapi-util/phpunit.xml delete mode 100644 vendor/alibabacloud/openapi-util/src/OpenApiUtilClient.php delete mode 100644 vendor/alibabacloud/openapi-util/tests/OpenApiUtilClientTest.php delete mode 100644 vendor/alibabacloud/openapi-util/tests/bootstrap.php delete mode 100644 vendor/alibabacloud/tea-utils/.gitignore delete mode 100644 vendor/alibabacloud/tea-utils/.php_cs.dist delete mode 100644 vendor/alibabacloud/tea-utils/README-CN.md delete mode 100644 vendor/alibabacloud/tea-utils/README.md delete mode 100644 vendor/alibabacloud/tea-utils/composer.json delete mode 100644 vendor/alibabacloud/tea-utils/phpunit.xml delete mode 100644 vendor/alibabacloud/tea-utils/src/Utils.php delete mode 100644 vendor/alibabacloud/tea-utils/src/Utils/RuntimeOptions.php delete mode 100644 vendor/alibabacloud/tea-utils/tests/UtilsTest.php delete mode 100644 vendor/alibabacloud/tea-utils/tests/bootstrap.php delete mode 100644 vendor/alibabacloud/tea/.php_cs.dist delete mode 100644 vendor/alibabacloud/tea/CHANGELOG.md delete mode 100644 vendor/alibabacloud/tea/LICENSE.md delete mode 100644 vendor/alibabacloud/tea/README.md delete mode 100644 vendor/alibabacloud/tea/composer.json delete mode 100644 vendor/alibabacloud/tea/src/Exception/TeaError.php delete mode 100644 vendor/alibabacloud/tea/src/Exception/TeaRetryError.php delete mode 100644 vendor/alibabacloud/tea/src/Exception/TeaUnableRetryError.php delete mode 100644 vendor/alibabacloud/tea/src/Helper.php delete mode 100644 vendor/alibabacloud/tea/src/Model.php delete mode 100644 vendor/alibabacloud/tea/src/Parameter.php delete mode 100644 vendor/alibabacloud/tea/src/Request.php delete mode 100644 vendor/alibabacloud/tea/src/Response.php delete mode 100644 vendor/alibabacloud/tea/src/Tea.php delete mode 100644 vendor/guzzlehttp/guzzle/CHANGELOG.md delete mode 100644 vendor/guzzlehttp/guzzle/LICENSE delete mode 100644 vendor/guzzlehttp/guzzle/README.md delete mode 100644 vendor/guzzlehttp/guzzle/UPGRADING.md delete mode 100644 vendor/guzzlehttp/guzzle/composer.json delete mode 100644 vendor/guzzlehttp/guzzle/src/BodySummarizer.php delete mode 100644 vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Client.php delete mode 100644 vendor/guzzlehttp/guzzle/src/ClientInterface.php delete mode 100644 vendor/guzzlehttp/guzzle/src/ClientTrait.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Exception/ClientException.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Exception/RequestException.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Exception/ServerException.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Exception/TransferException.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Handler/Proxy.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php delete mode 100644 vendor/guzzlehttp/guzzle/src/HandlerStack.php delete mode 100644 vendor/guzzlehttp/guzzle/src/MessageFormatter.php delete mode 100644 vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Middleware.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Pool.php delete mode 100644 vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php delete mode 100644 vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php delete mode 100644 vendor/guzzlehttp/guzzle/src/RequestOptions.php delete mode 100644 vendor/guzzlehttp/guzzle/src/RetryMiddleware.php delete mode 100644 vendor/guzzlehttp/guzzle/src/TransferStats.php delete mode 100644 vendor/guzzlehttp/guzzle/src/Utils.php delete mode 100644 vendor/guzzlehttp/guzzle/src/functions.php delete mode 100644 vendor/guzzlehttp/guzzle/src/functions_include.php delete mode 100644 vendor/guzzlehttp/guzzle/vendor-bin/php-cs-fixer/composer.json delete mode 100644 vendor/guzzlehttp/guzzle/vendor-bin/phpstan/composer.json delete mode 100644 vendor/guzzlehttp/guzzle/vendor-bin/psalm/composer.json delete mode 100644 vendor/guzzlehttp/promises/CHANGELOG.md delete mode 100644 vendor/guzzlehttp/promises/LICENSE delete mode 100644 vendor/guzzlehttp/promises/Makefile delete mode 100644 vendor/guzzlehttp/promises/README.md delete mode 100644 vendor/guzzlehttp/promises/composer.json delete mode 100644 vendor/guzzlehttp/promises/src/AggregateException.php delete mode 100644 vendor/guzzlehttp/promises/src/CancellationException.php delete mode 100644 vendor/guzzlehttp/promises/src/Coroutine.php delete mode 100644 vendor/guzzlehttp/promises/src/Create.php delete mode 100644 vendor/guzzlehttp/promises/src/Each.php delete mode 100644 vendor/guzzlehttp/promises/src/EachPromise.php delete mode 100644 vendor/guzzlehttp/promises/src/FulfilledPromise.php delete mode 100644 vendor/guzzlehttp/promises/src/Is.php delete mode 100644 vendor/guzzlehttp/promises/src/Promise.php delete mode 100644 vendor/guzzlehttp/promises/src/PromiseInterface.php delete mode 100644 vendor/guzzlehttp/promises/src/PromisorInterface.php delete mode 100644 vendor/guzzlehttp/promises/src/RejectedPromise.php delete mode 100644 vendor/guzzlehttp/promises/src/RejectionException.php delete mode 100644 vendor/guzzlehttp/promises/src/TaskQueue.php delete mode 100644 vendor/guzzlehttp/promises/src/TaskQueueInterface.php delete mode 100644 vendor/guzzlehttp/promises/src/Utils.php delete mode 100644 vendor/guzzlehttp/promises/src/functions.php delete mode 100644 vendor/guzzlehttp/promises/src/functions_include.php delete mode 100644 vendor/guzzlehttp/psr7/CHANGELOG.md delete mode 100644 vendor/guzzlehttp/psr7/LICENSE delete mode 100644 vendor/guzzlehttp/psr7/README.md delete mode 100644 vendor/guzzlehttp/psr7/composer.json delete mode 100644 vendor/guzzlehttp/psr7/src/AppendStream.php delete mode 100644 vendor/guzzlehttp/psr7/src/BufferStream.php delete mode 100644 vendor/guzzlehttp/psr7/src/CachingStream.php delete mode 100644 vendor/guzzlehttp/psr7/src/DroppingStream.php delete mode 100644 vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php delete mode 100644 vendor/guzzlehttp/psr7/src/FnStream.php delete mode 100644 vendor/guzzlehttp/psr7/src/Header.php delete mode 100644 vendor/guzzlehttp/psr7/src/HttpFactory.php delete mode 100644 vendor/guzzlehttp/psr7/src/InflateStream.php delete mode 100644 vendor/guzzlehttp/psr7/src/LazyOpenStream.php delete mode 100644 vendor/guzzlehttp/psr7/src/LimitStream.php delete mode 100644 vendor/guzzlehttp/psr7/src/Message.php delete mode 100644 vendor/guzzlehttp/psr7/src/MessageTrait.php delete mode 100644 vendor/guzzlehttp/psr7/src/MimeType.php delete mode 100644 vendor/guzzlehttp/psr7/src/MultipartStream.php delete mode 100644 vendor/guzzlehttp/psr7/src/NoSeekStream.php delete mode 100644 vendor/guzzlehttp/psr7/src/PumpStream.php delete mode 100644 vendor/guzzlehttp/psr7/src/Query.php delete mode 100644 vendor/guzzlehttp/psr7/src/Request.php delete mode 100644 vendor/guzzlehttp/psr7/src/Response.php delete mode 100644 vendor/guzzlehttp/psr7/src/Rfc7230.php delete mode 100644 vendor/guzzlehttp/psr7/src/ServerRequest.php delete mode 100644 vendor/guzzlehttp/psr7/src/Stream.php delete mode 100644 vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php delete mode 100644 vendor/guzzlehttp/psr7/src/StreamWrapper.php delete mode 100644 vendor/guzzlehttp/psr7/src/UploadedFile.php delete mode 100644 vendor/guzzlehttp/psr7/src/Uri.php delete mode 100644 vendor/guzzlehttp/psr7/src/UriNormalizer.php delete mode 100644 vendor/guzzlehttp/psr7/src/UriResolver.php delete mode 100644 vendor/guzzlehttp/psr7/src/Utils.php delete mode 100644 vendor/guzzlehttp/psr7/vendor-bin/php-cs-fixer/composer.json delete mode 100644 vendor/guzzlehttp/psr7/vendor-bin/phpstan/composer.json delete mode 100644 vendor/guzzlehttp/psr7/vendor-bin/psalm/composer.json delete mode 100644 vendor/lizhichao/one-sm/.github/FUNDING.yml delete mode 100644 vendor/lizhichao/one-sm/.github/workflows/sm.yml delete mode 100644 vendor/lizhichao/one-sm/.gitignore delete mode 100644 vendor/lizhichao/one-sm/.php_cs.dist delete mode 100644 vendor/lizhichao/one-sm/README.md delete mode 100644 vendor/lizhichao/one-sm/bench.php delete mode 100644 vendor/lizhichao/one-sm/composer.json delete mode 100644 vendor/lizhichao/one-sm/src/Sm3.php delete mode 100644 vendor/lizhichao/one-sm/src/Sm4.php delete mode 100644 vendor/lizhichao/one-sm/test.php delete mode 100644 vendor/lizhichao/one-sm/tests/sm3.php delete mode 100644 vendor/lizhichao/one-sm/tests/sm4.php create mode 100644 vendor/myclabs/php-enum/LICENSE create mode 100644 vendor/myclabs/php-enum/README.md create mode 100644 vendor/myclabs/php-enum/SECURITY.md create mode 100644 vendor/myclabs/php-enum/composer.json create mode 100644 vendor/myclabs/php-enum/src/Enum.php create mode 100644 vendor/myclabs/php-enum/src/PHPUnit/Comparator.php create mode 100644 vendor/myclabs/php-enum/stubs/Stringable.php delete mode 100644 vendor/psr/http-client/CHANGELOG.md delete mode 100644 vendor/psr/http-client/LICENSE delete mode 100644 vendor/psr/http-client/README.md delete mode 100644 vendor/psr/http-client/composer.json delete mode 100644 vendor/psr/http-client/src/ClientExceptionInterface.php delete mode 100644 vendor/psr/http-client/src/ClientInterface.php delete mode 100644 vendor/psr/http-client/src/NetworkExceptionInterface.php delete mode 100644 vendor/psr/http-client/src/RequestExceptionInterface.php delete mode 100644 vendor/psr/http-factory/.gitignore delete mode 100644 vendor/psr/http-factory/.pullapprove.yml delete mode 100644 vendor/psr/http-factory/LICENSE delete mode 100644 vendor/psr/http-factory/README.md delete mode 100644 vendor/psr/http-factory/composer.json delete mode 100644 vendor/psr/http-factory/src/RequestFactoryInterface.php delete mode 100644 vendor/psr/http-factory/src/ResponseFactoryInterface.php delete mode 100644 vendor/psr/http-factory/src/ServerRequestFactoryInterface.php delete mode 100644 vendor/psr/http-factory/src/StreamFactoryInterface.php delete mode 100644 vendor/psr/http-factory/src/UploadedFileFactoryInterface.php delete mode 100644 vendor/psr/http-factory/src/UriFactoryInterface.php delete mode 100644 vendor/psr/http-message/CHANGELOG.md delete mode 100644 vendor/psr/http-message/LICENSE delete mode 100644 vendor/psr/http-message/README.md delete mode 100644 vendor/psr/http-message/composer.json delete mode 100644 vendor/psr/http-message/src/MessageInterface.php delete mode 100644 vendor/psr/http-message/src/RequestInterface.php delete mode 100644 vendor/psr/http-message/src/ResponseInterface.php delete mode 100644 vendor/psr/http-message/src/ServerRequestInterface.php delete mode 100644 vendor/psr/http-message/src/StreamInterface.php delete mode 100644 vendor/psr/http-message/src/UploadedFileInterface.php delete mode 100644 vendor/psr/http-message/src/UriInterface.php create mode 100644 vendor/qiniu/php-sdk/.github/workflows/test-ci.yml create mode 100644 vendor/qiniu/php-sdk/.gitignore create mode 100644 vendor/qiniu/php-sdk/.scrutinizer.yml create mode 100644 vendor/qiniu/php-sdk/CHANGELOG.md create mode 100644 vendor/qiniu/php-sdk/CONTRIBUTING.md rename vendor/{ralouphie/getallheaders => qiniu/php-sdk}/LICENSE (95%) create mode 100644 vendor/qiniu/php-sdk/README.md create mode 100644 vendor/qiniu/php-sdk/autoload.php create mode 100644 vendor/qiniu/php-sdk/codecov.yml create mode 100644 vendor/qiniu/php-sdk/composer.json create mode 100644 vendor/qiniu/php-sdk/examples/README.md create mode 100644 vendor/qiniu/php-sdk/examples/bucket_lifecycleRule.php create mode 100644 vendor/qiniu/php-sdk/examples/cdn_get_bandwidth.php create mode 100644 vendor/qiniu/php-sdk/examples/cdn_get_flux.php create mode 100644 vendor/qiniu/php-sdk/examples/cdn_get_log_list.php create mode 100644 vendor/qiniu/php-sdk/examples/cdn_get_prefetch_list.php create mode 100644 vendor/qiniu/php-sdk/examples/cdn_get_refresh_list.php create mode 100644 vendor/qiniu/php-sdk/examples/cdn_refresh_urls_dirs.php create mode 100644 vendor/qiniu/php-sdk/examples/cdn_timestamp_antileech.php create mode 100644 vendor/qiniu/php-sdk/examples/censor_image.php create mode 100644 vendor/qiniu/php-sdk/examples/censor_video.php create mode 100644 vendor/qiniu/php-sdk/examples/delete_bucket.php create mode 100644 vendor/qiniu/php-sdk/examples/delete_bucketEvent.php create mode 100644 vendor/qiniu/php-sdk/examples/delete_bucketLifecycleRule.php create mode 100644 vendor/qiniu/php-sdk/examples/get_bucketEvents.php create mode 100644 vendor/qiniu/php-sdk/examples/get_bucketLifecycleRules.php create mode 100644 vendor/qiniu/php-sdk/examples/get_bucketList.php create mode 100644 vendor/qiniu/php-sdk/examples/get_bucketQuota.php create mode 100644 vendor/qiniu/php-sdk/examples/get_bucketinfo.php create mode 100644 vendor/qiniu/php-sdk/examples/get_bucketinfos.php create mode 100644 vendor/qiniu/php-sdk/examples/get_corsRules.php create mode 100644 vendor/qiniu/php-sdk/examples/image_url_builder.php create mode 100644 vendor/qiniu/php-sdk/examples/persistent_fop_init.php create mode 100644 vendor/qiniu/php-sdk/examples/persistent_fop_status.php create mode 100644 vendor/qiniu/php-sdk/examples/pfop_mkzip.php create mode 100644 vendor/qiniu/php-sdk/examples/pfop_vframe.php create mode 100644 vendor/qiniu/php-sdk/examples/pfop_video_avthumb.php create mode 100644 vendor/qiniu/php-sdk/examples/pfop_watermark.php create mode 100644 vendor/qiniu/php-sdk/examples/php-logo.png create mode 100644 vendor/qiniu/php-sdk/examples/prefop.php create mode 100644 vendor/qiniu/php-sdk/examples/put_bucketAccessMode.php create mode 100644 vendor/qiniu/php-sdk/examples/put_bucketAccessStyleMode.php create mode 100644 vendor/qiniu/php-sdk/examples/put_bucketEvent.php create mode 100644 vendor/qiniu/php-sdk/examples/put_bucketMaxAge.php create mode 100644 vendor/qiniu/php-sdk/examples/put_bucketQuota.php create mode 100644 vendor/qiniu/php-sdk/examples/put_referAntiLeech.php create mode 100644 vendor/qiniu/php-sdk/examples/qetag.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_asynch_fetch.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_batch_change_mime.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_batch_change_type.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_batch_copy.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_batch_delete.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_batch_delete_after_days.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_batch_move.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_batch_restore_ar.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_batch_stat.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_bucket_domains.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_buckets.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_change_mime.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_change_status.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_change_type.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_copy.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_delete.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_delete_after_days.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_download_urls.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_fetch.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_move.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_prefetch.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_restore.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_stat.php create mode 100644 vendor/qiniu/php-sdk/examples/rsf_list_bucket.php create mode 100644 vendor/qiniu/php-sdk/examples/rsf_list_files.php create mode 100644 vendor/qiniu/php-sdk/examples/rsf_v2list_bucket.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/README.md create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_createApp.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_create_roomToken.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_deleteApp.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_getApp.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_kickUser.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_listActiveRooms.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_listUser.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_stopMerge.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_updateApp.php create mode 100644 vendor/qiniu/php-sdk/examples/saveas.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/README.md create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_create_signature.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_create_template.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_delete_signature.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_delete_template.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_edit_signature.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_edit_template.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_query_send_sms.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_query_signature.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_query_single_signature.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_query_single_template.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_query_template.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_send_message.php create mode 100644 vendor/qiniu/php-sdk/examples/update_bucketEvent.php create mode 100644 vendor/qiniu/php-sdk/examples/update_bucketLifecycleRule.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_and_callback.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_and_pfop.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_mgr_init.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_multi_demos.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_simple_file.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_tokens.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_verify_callback.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_with_qvmzone.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_with_zone.php create mode 100644 vendor/qiniu/php-sdk/phpunit.xml.dist create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Auth.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Cdn/CdnManager.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Config.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Enum/QiniuEnum.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Enum/SplitUploadVersion.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Etag.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Http/Client.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Http/Error.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Http/Header.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Http/Middleware/Middleware.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Http/Middleware/RetryDomainsMiddleware.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Http/Proxy.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Http/Request.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Http/RequestOptions.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Http/Response.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Processing/ImageUrlBuilder.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Processing/Operation.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Processing/PersistentFop.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Region.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Rtc/AppClient.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Sms/Sms.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Storage/ArgusManager.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Storage/BucketManager.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Storage/FormUploader.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Storage/ResumeUploader.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Storage/UploadManager.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Zone.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/functions.php create mode 100644 vendor/qiniu/php-sdk/test-env.sh create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/AuthTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/Base64Test.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/BucketTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/CdnManagerTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/ConfigTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/Crc32Test.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/DownloadTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/EntryTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/EtagTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/FopTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/FormUpTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/HeaderTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/HttpTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/ImageUrlBuilderTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/MiddlewareTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/PfopTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/ResumeUpTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/ZoneTest.php create mode 100644 vendor/qiniu/php-sdk/tests/bootstrap.php create mode 100644 vendor/qiniu/php-sdk/tests/mock-server/ok.php create mode 100644 vendor/qiniu/php-sdk/tests/mock-server/redirect.php create mode 100644 vendor/qiniu/php-sdk/tests/mock-server/timeout.php create mode 100644 vendor/qiniu/php-sdk/tests/socks5-server/go.mod create mode 100644 vendor/qiniu/php-sdk/tests/socks5-server/go.sum create mode 100644 vendor/qiniu/php-sdk/tests/socks5-server/main.go delete mode 100644 vendor/ralouphie/getallheaders/README.md delete mode 100644 vendor/ralouphie/getallheaders/composer.json delete mode 100644 vendor/ralouphie/getallheaders/src/getallheaders.php delete mode 100644 vendor/symfony/deprecation-contracts/.gitignore delete mode 100644 vendor/symfony/deprecation-contracts/CHANGELOG.md delete mode 100644 vendor/symfony/deprecation-contracts/LICENSE delete mode 100644 vendor/symfony/deprecation-contracts/README.md delete mode 100644 vendor/symfony/deprecation-contracts/composer.json delete mode 100644 vendor/symfony/deprecation-contracts/function.php diff --git a/vendor/adbario/php-dot-notation/LICENSE.md b/vendor/adbario/php-dot-notation/LICENSE.md deleted file mode 100644 index fe01323..0000000 --- a/vendor/adbario/php-dot-notation/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -# The MIT License (MIT) - -Copyright (c) 2016-2019 Riku Särkinen - -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/adbario/php-dot-notation/composer.json b/vendor/adbario/php-dot-notation/composer.json deleted file mode 100644 index b7b82cb..0000000 --- a/vendor/adbario/php-dot-notation/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "adbario/php-dot-notation", - "description": "PHP dot notation access to arrays", - "keywords": ["dotnotation", "arrayaccess"], - "homepage": "https://github.com/adbario/php-dot-notation", - "license": "MIT", - "authors": [ - { - "name": "Riku Särkinen", - "email": "riku@adbar.io" - } - ], - "require": { - "php": ">=5.5", - "ext-json": "*" - }, - "require-dev": { - "phpunit/phpunit": "^4.0|^5.0|^6.0", - "squizlabs/php_codesniffer": "^3.0" - }, - "autoload": { - "files": [ - "src/helpers.php" - ], - "psr-4": { - "Adbar\\": "src" - } - } -} diff --git a/vendor/adbario/php-dot-notation/src/Dot.php b/vendor/adbario/php-dot-notation/src/Dot.php deleted file mode 100644 index 8d504d9..0000000 --- a/vendor/adbario/php-dot-notation/src/Dot.php +++ /dev/null @@ -1,601 +0,0 @@ - - * @link https://github.com/adbario/php-dot-notation - * @license https://github.com/adbario/php-dot-notation/blob/2.x/LICENSE.md (MIT License) - */ -namespace Adbar; - -use Countable; -use ArrayAccess; -use ArrayIterator; -use JsonSerializable; -use IteratorAggregate; - -/** - * Dot - * - * This class provides a dot notation access and helper functions for - * working with arrays of data. Inspired by Laravel Collection. - */ -class Dot implements ArrayAccess, Countable, IteratorAggregate, JsonSerializable -{ - /** - * The stored items - * - * @var array - */ - protected $items = []; - - /** - * Create a new Dot instance - * - * @param mixed $items - */ - public function __construct($items = []) - { - $this->items = $this->getArrayItems($items); - } - - /** - * Set a given key / value pair or pairs - * if the key doesn't exist already - * - * @param array|int|string $keys - * @param mixed $value - */ - public function add($keys, $value = null) - { - if (is_array($keys)) { - foreach ($keys as $key => $value) { - $this->add($key, $value); - } - } elseif (is_null($this->get($keys))) { - $this->set($keys, $value); - } - } - - /** - * Return all the stored items - * - * @return array - */ - public function all() - { - return $this->items; - } - - /** - * Delete the contents of a given key or keys - * - * @param array|int|string|null $keys - */ - public function clear($keys = null) - { - if (is_null($keys)) { - $this->items = []; - - return; - } - - $keys = (array) $keys; - - foreach ($keys as $key) { - $this->set($key, []); - } - } - - /** - * Delete the given key or keys - * - * @param array|int|string $keys - */ - public function delete($keys) - { - $keys = (array) $keys; - - foreach ($keys as $key) { - if ($this->exists($this->items, $key)) { - unset($this->items[$key]); - - continue; - } - - $items = &$this->items; - $segments = explode('.', $key); - $lastSegment = array_pop($segments); - - foreach ($segments as $segment) { - if (!isset($items[$segment]) || !is_array($items[$segment])) { - continue 2; - } - - $items = &$items[$segment]; - } - - unset($items[$lastSegment]); - } - } - - /** - * Checks if the given key exists in the provided array. - * - * @param array $array Array to validate - * @param int|string $key The key to look for - * - * @return bool - */ - protected function exists($array, $key) - { - return array_key_exists($key, $array); - } - - /** - * Flatten an array with the given character as a key delimiter - * - * @param string $delimiter - * @param array|null $items - * @param string $prepend - * @return array - */ - public function flatten($delimiter = '.', $items = null, $prepend = '') - { - $flatten = []; - - if (is_null($items)) { - $items = $this->items; - } - - foreach ($items as $key => $value) { - if (is_array($value) && !empty($value)) { - $flatten = array_merge( - $flatten, - $this->flatten($delimiter, $value, $prepend.$key.$delimiter) - ); - } else { - $flatten[$prepend.$key] = $value; - } - } - - return $flatten; - } - - /** - * Return the value of a given key - * - * @param int|string|null $key - * @param mixed $default - * @return mixed - */ - public function get($key = null, $default = null) - { - if (is_null($key)) { - return $this->items; - } - - if ($this->exists($this->items, $key)) { - return $this->items[$key]; - } - - if (strpos($key, '.') === false) { - return $default; - } - - $items = $this->items; - - foreach (explode('.', $key) as $segment) { - if (!is_array($items) || !$this->exists($items, $segment)) { - return $default; - } - - $items = &$items[$segment]; - } - - return $items; - } - - /** - * Return the given items as an array - * - * @param mixed $items - * @return array - */ - protected function getArrayItems($items) - { - if (is_array($items)) { - return $items; - } elseif ($items instanceof self) { - return $items->all(); - } - - return (array) $items; - } - - /** - * Check if a given key or keys exists - * - * @param array|int|string $keys - * @return bool - */ - public function has($keys) - { - $keys = (array) $keys; - - if (!$this->items || $keys === []) { - return false; - } - - foreach ($keys as $key) { - $items = $this->items; - - if ($this->exists($items, $key)) { - continue; - } - - foreach (explode('.', $key) as $segment) { - if (!is_array($items) || !$this->exists($items, $segment)) { - return false; - } - - $items = $items[$segment]; - } - } - - return true; - } - - /** - * Check if a given key or keys are empty - * - * @param array|int|string|null $keys - * @return bool - */ - public function isEmpty($keys = null) - { - if (is_null($keys)) { - return empty($this->items); - } - - $keys = (array) $keys; - - foreach ($keys as $key) { - if (!empty($this->get($key))) { - return false; - } - } - - return true; - } - - /** - * Merge a given array or a Dot object with the given key - * or with the whole Dot object - * - * @param array|string|self $key - * @param array|self $value - */ - public function merge($key, $value = []) - { - if (is_array($key)) { - $this->items = array_merge($this->items, $key); - } elseif (is_string($key)) { - $items = (array) $this->get($key); - $value = array_merge($items, $this->getArrayItems($value)); - - $this->set($key, $value); - } elseif ($key instanceof self) { - $this->items = array_merge($this->items, $key->all()); - } - } - - /** - * Recursively merge a given array or a Dot object with the given key - * or with the whole Dot object. - * - * Duplicate keys are converted to arrays. - * - * @param array|string|self $key - * @param array|self $value - */ - public function mergeRecursive($key, $value = []) - { - if (is_array($key)) { - $this->items = array_merge_recursive($this->items, $key); - } elseif (is_string($key)) { - $items = (array) $this->get($key); - $value = array_merge_recursive($items, $this->getArrayItems($value)); - - $this->set($key, $value); - } elseif ($key instanceof self) { - $this->items = array_merge_recursive($this->items, $key->all()); - } - } - - /** - * Recursively merge a given array or a Dot object with the given key - * or with the whole Dot object. - * - * Instead of converting duplicate keys to arrays, the value from - * given array will replace the value in Dot object. - * - * @param array|string|self $key - * @param array|self $value - */ - public function mergeRecursiveDistinct($key, $value = []) - { - if (is_array($key)) { - $this->items = $this->arrayMergeRecursiveDistinct($this->items, $key); - } elseif (is_string($key)) { - $items = (array) $this->get($key); - $value = $this->arrayMergeRecursiveDistinct($items, $this->getArrayItems($value)); - - $this->set($key, $value); - } elseif ($key instanceof self) { - $this->items = $this->arrayMergeRecursiveDistinct($this->items, $key->all()); - } - } - - /** - * Merges two arrays recursively. In contrast to array_merge_recursive, - * duplicate keys are not converted to arrays but rather overwrite the - * value in the first array with the duplicate value in the second array. - * - * @param array $array1 Initial array to merge - * @param array $array2 Array to recursively merge - * @return array - */ - protected function arrayMergeRecursiveDistinct(array $array1, array $array2) - { - $merged = &$array1; - - foreach ($array2 as $key => $value) { - if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) { - $merged[$key] = $this->arrayMergeRecursiveDistinct($merged[$key], $value); - } else { - $merged[$key] = $value; - } - } - - return $merged; - } - - /** - * Return the value of a given key and - * delete the key - * - * @param int|string|null $key - * @param mixed $default - * @return mixed - */ - public function pull($key = null, $default = null) - { - if (is_null($key)) { - $value = $this->all(); - $this->clear(); - - return $value; - } - - $value = $this->get($key, $default); - $this->delete($key); - - return $value; - } - - /** - * Push a given value to the end of the array - * in a given key - * - * @param mixed $key - * @param mixed $value - */ - public function push($key, $value = null) - { - if (is_null($value)) { - $this->items[] = $key; - - return; - } - - $items = $this->get($key); - - if (is_array($items) || is_null($items)) { - $items[] = $value; - $this->set($key, $items); - } - } - - /** - * Replace all values or values within the given key - * with an array or Dot object - * - * @param array|string|self $key - * @param array|self $value - */ - public function replace($key, $value = []) - { - if (is_array($key)) { - $this->items = array_replace($this->items, $key); - } elseif (is_string($key)) { - $items = (array) $this->get($key); - $value = array_replace($items, $this->getArrayItems($value)); - - $this->set($key, $value); - } elseif ($key instanceof self) { - $this->items = array_replace($this->items, $key->all()); - } - } - - /** - * Set a given key / value pair or pairs - * - * @param array|int|string $keys - * @param mixed $value - */ - public function set($keys, $value = null) - { - if (is_array($keys)) { - foreach ($keys as $key => $value) { - $this->set($key, $value); - } - - return; - } - - $items = &$this->items; - - foreach (explode('.', $keys) as $key) { - if (!isset($items[$key]) || !is_array($items[$key])) { - $items[$key] = []; - } - - $items = &$items[$key]; - } - - $items = $value; - } - - /** - * Replace all items with a given array - * - * @param mixed $items - */ - public function setArray($items) - { - $this->items = $this->getArrayItems($items); - } - - /** - * Replace all items with a given array as a reference - * - * @param array $items - */ - public function setReference(array &$items) - { - $this->items = &$items; - } - - /** - * Return the value of a given key or all the values as JSON - * - * @param mixed $key - * @param int $options - * @return string - */ - public function toJson($key = null, $options = 0) - { - if (is_string($key)) { - return json_encode($this->get($key), $options); - } - - $options = $key === null ? 0 : $key; - - return json_encode($this->items, $options); - } - - /* - * -------------------------------------------------------------- - * ArrayAccess interface - * -------------------------------------------------------------- - */ - - /** - * Check if a given key exists - * - * @param int|string $key - * @return bool - */ - public function offsetExists($key) - { - return $this->has($key); - } - - /** - * Return the value of a given key - * - * @param int|string $key - * @return mixed - */ - public function offsetGet($key) - { - return $this->get($key); - } - - /** - * Set a given value to the given key - * - * @param int|string|null $key - * @param mixed $value - */ - public function offsetSet($key, $value) - { - if (is_null($key)) { - $this->items[] = $value; - - return; - } - - $this->set($key, $value); - } - - /** - * Delete the given key - * - * @param int|string $key - */ - public function offsetUnset($key) - { - $this->delete($key); - } - - /* - * -------------------------------------------------------------- - * Countable interface - * -------------------------------------------------------------- - */ - - /** - * Return the number of items in a given key - * - * @param int|string|null $key - * @return int - */ - public function count($key = null) - { - return count($this->get($key)); - } - - /* - * -------------------------------------------------------------- - * IteratorAggregate interface - * -------------------------------------------------------------- - */ - - /** - * Get an iterator for the stored items - * - * @return \ArrayIterator - */ - public function getIterator() - { - return new ArrayIterator($this->items); - } - - /* - * -------------------------------------------------------------- - * JsonSerializable interface - * -------------------------------------------------------------- - */ - - /** - * Return items for JSON serialization - * - * @return array - */ - public function jsonSerialize() - { - return $this->items; - } -} diff --git a/vendor/adbario/php-dot-notation/src/helpers.php b/vendor/adbario/php-dot-notation/src/helpers.php deleted file mode 100644 index ffdc826..0000000 --- a/vendor/adbario/php-dot-notation/src/helpers.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @link https://github.com/adbario/php-dot-notation - * @license https://github.com/adbario/php-dot-notation/blob/2.x/LICENSE.md (MIT License) - */ - -use Adbar\Dot; - -if (! function_exists('dot')) { - /** - * Create a new Dot object with the given items - * - * @param mixed $items - * @return \Adbar\Dot - */ - function dot($items) - { - return new Dot($items); - } -} diff --git a/vendor/alibabacloud/credentials/CHANGELOG.md b/vendor/alibabacloud/credentials/CHANGELOG.md deleted file mode 100644 index 6180270..0000000 --- a/vendor/alibabacloud/credentials/CHANGELOG.md +++ /dev/null @@ -1,14 +0,0 @@ -# CHANGELOG - -## 1.1.3 - 2020-12-24 - -- Require guzzle ^6.3|^7.0 - -## 1.0.2 - 2020-02-14 -- Update Tea. - -## 1.0.1 - 2019-12-30 -- Supported get `Role Name` automatically. - -## 1.0.0 - 2019-09-01 -- Initial release of the Alibaba Cloud Credentials for PHP Version 1.0.0 on Packagist See for more information. diff --git a/vendor/alibabacloud/credentials/CONTRIBUTING.md b/vendor/alibabacloud/credentials/CONTRIBUTING.md deleted file mode 100644 index 8ed9330..0000000 --- a/vendor/alibabacloud/credentials/CONTRIBUTING.md +++ /dev/null @@ -1,30 +0,0 @@ -# CONTRIBUTING - -We work hard to provide a high-quality and useful SDK for Alibaba Cloud, and -we greatly value feedback and contributions from our community. Please submit -your [issues][issues] or [pull requests][pull-requests] through GitHub. - -## Tips - -- The SDK is released under the [Apache license][license]. Any code you submit - will be released under that license. For substantial contributions, we may - ask you to sign a [Alibaba Documentation Corporate Contributor License - Agreement (CLA)][cla]. -- We follow all of the relevant PSR recommendations from the [PHP Framework - Interop Group][php-fig]. Please submit code that follows these standards. - The [PHP CS Fixer][cs-fixer] tool can be helpful for formatting your code. - Your can use `composer fixer` to fix code. -- We maintain a high percentage of code coverage in our unit tests. If you make - changes to the code, please add, update, and/or remove tests as appropriate. -- If your code does not conform to the PSR standards, does not include adequate - tests, or does not contain a changelog document, we may ask you to update - your pull requests before we accept them. We also reserve the right to deny - any pull requests that do not align with our standards or goals. - -[issues]: https://github.com/aliyun/credentials-php/issues -[pull-requests]: https://github.com/aliyun/credentials-php/pulls -[license]: http://www.apache.org/licenses/LICENSE-2.0 -[cla]: https://alibaba-cla-2018.oss-cn-beijing.aliyuncs.com/Alibaba_Documentation_Open_Source_Corporate_CLA.pdf -[php-fig]: http://php-fig.org -[cs-fixer]: http://cs.sensiolabs.org/ -[docs-readme]: https://github.com/aliyun/credentials-php/blob/master/README.md diff --git a/vendor/alibabacloud/credentials/LICENSE.md b/vendor/alibabacloud/credentials/LICENSE.md deleted file mode 100644 index ec13fcc..0000000 --- a/vendor/alibabacloud/credentials/LICENSE.md +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2009-present, Alibaba Cloud All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/vendor/alibabacloud/credentials/NOTICE.md b/vendor/alibabacloud/credentials/NOTICE.md deleted file mode 100644 index 97db193..0000000 --- a/vendor/alibabacloud/credentials/NOTICE.md +++ /dev/null @@ -1,88 +0,0 @@ -# NOTICE - - - -Copyright (c) 2009-present, Alibaba Cloud All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"). -You may not use this file except in compliance with the License. -A copy of the License is located at - - - -or in the "license" file accompanying this file. This file is distributed -on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either -express or implied. See the License for the specific language governing -permissions and limitations under the License. - -# Guzzle - - - -Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling - -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. - -# jmespath.php - - - -Copyright (c) 2014 Michael Dowling, https://github.com/mtdowling - -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. - -# Dot - - - -Copyright (c) 2016-2019 Riku Särkinen - -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/alibabacloud/credentials/README-zh-CN.md b/vendor/alibabacloud/credentials/README-zh-CN.md deleted file mode 100644 index 262cad9..0000000 --- a/vendor/alibabacloud/credentials/README-zh-CN.md +++ /dev/null @@ -1,250 +0,0 @@ -[English](/README.md) | 简体中文 - - -# Alibaba Cloud Credentials for PHP -[![Latest Stable Version](https://poser.pugx.org/alibabacloud/credentials/v/stable)](https://packagist.org/packages/alibabacloud/credentials) -[![composer.lock](https://poser.pugx.org/alibabacloud/credentials/composerlock)](https://packagist.org/packages/alibabacloud/credentials) -[![Total Downloads](https://poser.pugx.org/alibabacloud/credentials/downloads)](https://packagist.org/packages/alibabacloud/credentials) -[![License](https://poser.pugx.org/alibabacloud/credentials/license)](https://packagist.org/packages/alibabacloud/credentials) -[![codecov](https://codecov.io/gh/aliyun/credentials-php/branch/master/graph/badge.svg)](https://codecov.io/gh/aliyun/credentials-php) -[![Travis Build Status](https://travis-ci.org/aliyun/credentials-php.svg?branch=master)](https://travis-ci.org/aliyun/credentials-php) -[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/6jxpwmhyfipagtge/branch/master?svg=true)](https://ci.appveyor.com/project/aliyun/credentials-php) - - -![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg) - - -Alibaba Cloud Credentials for PHP 是帮助 PHP 开发者管理凭据的工具。 - - -## 先决条件 -您的系统需要满足[先决条件](/docs/zh-CN/0-Prerequisites.md),包括 PHP> = 5.6。 我们强烈建议使用cURL扩展,并使用TLS后端编译cURL 7.16.2+。 - - -## 安装依赖 -如果已在系统上[全局安装 Composer](https://getcomposer.org/doc/00-intro.md#globally),请直接在项目目录中运行以下内容来安装 Alibaba Cloud Credentials for PHP 作为依赖项: -``` -composer require alibabacloud/credentials -``` -> 一些用户可能由于网络问题无法安装,可以使用[阿里云 Composer 全量镜像](https://developer.aliyun.com/composer)。 - -请看[安装](/docs/zh-CN/1-Installation.md)有关通过 Composer 和其他方式安装的详细信息。 - - -## 快速使用 -在您开始之前,您需要注册阿里云帐户并获取您的[凭证](https://usercenter.console.aliyun.com/#/manage/ak)。 - -### 凭证类型 - -#### AccessKey - -通过[用户信息管理][ak]设置 access_key,它们具有该账户完全的权限,请妥善保管。有时出于安全考虑,您不能把具有完全访问权限的主账户 AccessKey 交于一个项目的开发者使用,您可以[创建RAM子账户][ram]并为子账户[授权][permissions],使用RAM子用户的 AccessKey 来进行API调用。 - -```php -getAccessKeyId(); -$credential->getAccessKeySecret(); - -// Access Key -$ak = new Credential([ - 'type' => 'access_key', - 'access_key_id' => '', - 'access_key_secret' => '', -]); -$ak->getAccessKeyId(); -$ak->getAccessKeySecret(); -``` - -#### STS - -通过安全令牌服务(Security Token Service,简称 STS),申请临时安全凭证(Temporary Security Credentials,简称 TSC),创建临时安全凭证。 - -```php - 'sts', - 'access_key_id' => '', - 'accessKey_secret' => '', - 'security_token' => '', -]); -$sts->getAccessKeyId(); -$sts->getAccessKeySecret(); -$sts->getSecurityToken(); -``` - -#### RamRoleArn - -通过指定[RAM角色][RAM Role],让凭证自动申请维护 STS Token。你可以通过为 `Policy` 赋值来限制获取到的 STS Token 的权限。 - -```php - 'ram_role_arn', - 'access_key_id' => '', - 'access_key_secret' => '', - 'role_arn' => '', - 'role_session_name' => '', - 'policy' => '', -]); -$ramRoleArn->getAccessKeyId(); -$ramRoleArn->getAccessKeySecret(); -$ramRoleArn->getRoleArn(); -$ramRoleArn->getRoleSessionName(); -$ramRoleArn->getPolicy(); -``` - -#### EcsRamRole - -通过指定角色名称,让凭证自动申请维护 STS Token - -```php - 'ecs_ram_role', - 'role_name' => '', -]); -$ecsRamRole->getRoleName(); -// Note: `role_name` is optional. It will be retrieved automatically if not set. It is highly recommended to set it up to reduce requests. -``` - -#### RsaKeyPair - -通过指定公钥Id和私钥文件,让凭证自动申请维护 AccessKey。仅支持日本站。 - -```php - 'rsa_key_pair', - 'public_key_id' => '', - 'private_key_file' => '', -]); -$rsaKeyPair->getPublicKeyId(); -$rsaKeyPair->getPrivateKey(); -``` - -#### Bearer Token - -如呼叫中心(CCC)需用此凭证,请自行申请维护 Bearer Token。 - -```php - 'bearer_token', - 'bearer_token' => '', -]); -$bearerToken->getBearerToken(); -$bearerToken->getSignature(); -``` - -## 默认凭证提供程序链 -默认凭证提供程序链查找可用的凭证,寻找顺序如下: - -### 1. 环境凭证 -程序首先会在环境变量里寻找环境凭证,如果定义了 `ALIBABA_CLOUD_ACCESS_KEY_ID` 和 `ALIBABA_CLOUD_ACCESS_KEY_SECRET` 环境变量且不为空,程序将使用他们创建默认凭证。 - -### 2. 配置文件 -> 如果用户主目录存在默认文件 `~/.alibabacloud/credentials` (Windows 为 `C:\Users\USER_NAME\.alibabacloud\credentials`),程序会自动创建指定类型和名称的凭证。默认文件可以不存在,但解析错误会抛出异常。 凭证名称不分大小写,若凭证同名,后者会覆盖前者。不同的项目、工具之间可以共用这个配置文件,因为超出项目之外,也不会被意外提交到版本控制。Windows 上可以使用环境变量引用到主目录 %UserProfile%。类 Unix 的系统可以使用环境变量 $HOME 或 ~ (tilde)。 可以通过定义 `ALIBABA_CLOUD_CREDENTIALS_FILE` 环境变量修改默认文件的路径。 - -```ini -[default] -type = access_key # 认证方式为 access_key -access_key_id = foo # Key -access_key_secret = bar # Secret - -[project1] -type = ecs_ram_role # 认证方式为 ecs_ram_role -role_name = EcsRamRoleTest # Role Name,非必填,不填则自动获取,建议设置,可以减少网络请求。 - -[project2] -type = ram_role_arn # 认证方式为 ram_role_arn -access_key_id = foo -access_key_secret = bar -role_arn = role_arn -role_session_name = session_name - -[project3] -type = rsa_key_pair # 认证方式为 rsa_key_pair -public_key_id = publicKeyId # Public Key ID -private_key_file = /your/pk.pem # Private Key 文件 -``` - -### 3. 实例 RAM 角色 -如果定义了环境变量 `ALIBABA_CLOUD_ECS_METADATA` 且不为空,程序会将该环境变量的值作为角色名称,请求 `http://100.100.100.200/latest/meta-data/ram/security-credentials/` 获取临时安全凭证作为默认凭证。 - -### 自定义凭证提供程序链 -可通过自定义程序链代替默认程序链的寻找顺序,也可以自行编写闭包传入提供者。 -```php - = 5.6. We strongly recommend using the cURL extension and compiling cURL 7.16.2+ using the TLS backend. - - -## Installation -If you have [Globally Install Composer](https://getcomposer.org/doc/00-intro.md#globally) on your system, install Alibaba Cloud Credentials for PHP as a dependency by running the following directly in the project directory: -``` -composer require alibabacloud/credentials -``` -> Some users may not be able to install due to network problems, you can switch to the [Alibaba Cloud Composer Mirror](https://developer.aliyun.com/composer). - -See [Installation](/docs/zh-CN/1-Installation.md) for details on installing through Composer and other means. - - -## Quick Examples -Before you begin, you need to sign up for an Alibaba Cloud account and retrieve your [Credentials](https://usercenter.console.aliyun.com/#/manage/ak). - -### Credential Type - -#### AccessKey - -Setup access_key credential through [User Information Management][ak], it have full authority over the account, please keep it safe. Sometimes for security reasons, you cannot hand over a primary account AccessKey with full access to the developer of a project. You may create a sub-account [RAM Sub-account][ram] , grant its [authorization][permissions],and use the AccessKey of RAM Sub-account. - -```php -getAccessKeyId(); -$credential->getAccessKeySecret(); - -// Access Key -$ak = new Credential([ - 'type' => 'access_key', - 'access_key_id' => '', - 'access_key_secret' => '', -]); -$ak->getAccessKeyId(); -$ak->getAccessKeySecret(); -``` - -#### STS - -Create a temporary security credential by applying Temporary Security Credentials (TSC) through the Security Token Service (STS). - -```php - 'sts', - 'access_key_id' => '', - 'accessKey_secret' => '', - 'security_token' => '', -]); -$sts->getAccessKeyId(); -$sts->getAccessKeySecret(); -$sts->getSecurityToken(); -``` - -#### RamRoleArn - -By specifying [RAM Role][RAM Role], the credential will be able to automatically request maintenance of STS Token. If you want to limit the permissions([How to make a policy][policy]) of STS Token, you can assign value for `Policy`. - -```php - 'ram_role_arn', - 'access_key_id' => '', - 'access_key_secret' => '', - 'role_arn' => '', - 'role_session_name' => '', - 'policy' => '', -]); -$ramRoleArn->getAccessKeyId(); -$ramRoleArn->getAccessKeySecret(); -$ramRoleArn->getRoleArn(); -$ramRoleArn->getRoleSessionName(); -$ramRoleArn->getPolicy(); -``` - -#### EcsRamRole - -By specifying the role name, the credential will be able to automatically request maintenance of STS Token. - -```php - 'ecs_ram_role', - 'role_name' => '', -]); -$ecsRamRole->getRoleName(); -// Note: `role_name` is optional. It will be retrieved automatically if not set. It is highly recommended to set it up to reduce requests. -``` - -#### RsaKeyPair - -By specifying the public key Id and the private key file, the credential will be able to automatically request maintenance of the AccessKey before sending the request. Only Japan station is supported. - - -```php - 'rsa_key_pair', - 'public_key_id' => '', - 'private_key_file' => '', -]); -$rsaKeyPair->getPublicKeyId(); -$rsaKeyPair->getPrivateKey(); -``` - -#### Bearer Token - -If credential is required by the Cloud Call Centre (CCC), please apply for Bearer Token maintenance by yourself. - -```php - 'bearer_token', - 'bearer_token' => '', -]); -$bearerToken->getBearerToken(); -$bearerToken->getSignature(); -``` - -## Default credential provider chain -The default credential provider chain looks for available credentials, looking in the following order: - -### 1. Environmental certificate -The program first looks for environment credentials in the environment variable. If the `ALIBABA_CLOUD_ACCESS_KEY_ID` and `ALIBABA_CLOUD_ACCESS_KEY_SECRET` environment variables are defined and not empty, the program will use them to create default credentials. - -### 2. Configuration file -> If the user's home directory has the default file `~/.alibabacloud/credentials` (Windows is `C:\Users\USER_NAME\.alibabacloud\credentials`), the program will automatically create credentials with the specified type and name. The default file may not exist, but parsing errors will throw an exception. The voucher name is not case sensitive. If the voucher has the same name, the latter will overwrite the former. This configuration file can be shared between different projects and tools, and it will not be accidentally submitted to version control because it is outside the project. Environment variables can be referenced to the home directory %UserProfile% on Windows. Unix-like systems can use the environment variable $HOME or ~ (tilde). The path to the default file can be modified by defining the `ALIBABA_CLOUD_CREDENTIALS_FILE` environment variable. - -```ini -[default] -type = access_key # Authentication method is access_key -access_key_id = foo # Key -access_key_secret = bar # Secret - -[project1] -type = ecs_ram_role # Authentication method is ecs_ram_role -role_name = EcsRamRoleTest # Role name, optional. It will be retrieved automatically if not set. It is highly recommended to set it up to reduce requests. - -[project2] -type = ram_role_arn # Authentication method is ram_role_arn -access_key_id = foo -access_key_secret = bar -role_arn = role_arn -role_session_name = session_name - -[project3] -type = rsa_key_pair # Authentication method is rsa_key_pair -public_key_id = publicKeyId # Public Key ID -private_key_file = /your/pk.pem # Private Key File -``` - -### 3. Instance RAM role -If the environment variable `ALIBABA_CLOUD_ECS_METADATA` is defined and not empty, the program will take the value of the environment variable as the role name and request `http://100.100.100.200/latest/meta-data/ram/security-credentials/` to get the temporary Security credentials are used as default credentials. - -### Custom credential provider chain -You can replace the default order of the program chain by customizing the program chain, or you can write the closure to the provider. -```php - for more information. diff --git a/vendor/alibabacloud/credentials/composer.json b/vendor/alibabacloud/credentials/composer.json deleted file mode 100644 index 3e266d8..0000000 --- a/vendor/alibabacloud/credentials/composer.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "name": "alibabacloud/credentials", - "homepage": "https://www.alibabacloud.com/", - "description": "Alibaba Cloud Credentials for PHP", - "keywords": [ - "sdk", - "tool", - "cloud", - "client", - "aliyun", - "library", - "alibaba", - "Credentials", - "alibabacloud" - ], - "type": "library", - "license": "Apache-2.0", - "support": { - "source": "https://github.com/aliyun/credentials-php", - "issues": "https://github.com/aliyun/credentials-php/issues" - }, - "authors": [ - { - "name": "Alibaba Cloud SDK", - "email": "sdk-team@alibabacloud.com", - "homepage": "http://www.alibabacloud.com" - } - ], - "require": { - "php": ">=5.6", - "ext-curl": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-openssl": "*", - "ext-mbstring": "*", - "ext-simplexml": "*", - "ext-xmlwriter": "*", - "guzzlehttp/guzzle": "^6.3|^7.0", - "adbario/php-dot-notation": "^2.2", - "alibabacloud/tea": "^3.0" - }, - "require-dev": { - "ext-spl": "*", - "ext-dom": "*", - "ext-pcre": "*", - "psr/cache": "^1.0", - "ext-sockets": "*", - "drupal/coder": "^8.3", - "symfony/dotenv": "^3.4", - "phpunit/phpunit": "^4.8.35|^5.4.3", - "monolog/monolog": "^1.24", - "composer/composer": "^1.8", - "mikey179/vfsstream": "^1.6", - "symfony/var-dumper": "^3.4" - }, - "suggest": { - "ext-sockets": "To use client-side monitoring" - }, - "autoload": { - "psr-4": { - "AlibabaCloud\\Credentials\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "AlibabaCloud\\Credentials\\Tests\\": "tests/" - } - }, - "config": { - "preferred-install": "dist", - "optimize-autoloader": true - }, - "minimum-stability": "dev", - "prefer-stable": true, - "scripts-descriptions": { - "cs": "Tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard.", - "cbf": "Automatically correct coding standard violations.", - "fixer": "Fixes code to follow standards.", - "test": "Run all tests.", - "unit": "Run Unit tests.", - "feature": "Run Feature tests.", - "clearCache": "Clear cache like coverage.", - "coverage": "Show Coverage html.", - "endpoints": "Update endpoints from OSS." - }, - "scripts": { - "cs": "phpcs --standard=PSR2 -n ./", - "cbf": "phpcbf --standard=PSR2 -n ./", - "fixer": "php-cs-fixer fix ./", - "test": [ - "phpunit --colors=always" - ], - "unit": [ - "@clearCache", - "phpunit --testsuite=Unit --colors=always" - ], - "feature": [ - "@clearCache", - "phpunit --testsuite=Feature --colors=always" - ], - "coverage": "open cache/coverage/index.html", - "clearCache": "rm -rf cache/*" - } -} diff --git a/vendor/alibabacloud/credentials/src/AccessKeyCredential.php b/vendor/alibabacloud/credentials/src/AccessKeyCredential.php deleted file mode 100644 index 6d7d7c9..0000000 --- a/vendor/alibabacloud/credentials/src/AccessKeyCredential.php +++ /dev/null @@ -1,72 +0,0 @@ -accessKeyId = $access_key_id; - $this->accessKeySecret = $access_key_secret; - } - - /** - * @return string - */ - public function getAccessKeyId() - { - return $this->accessKeyId; - } - - /** - * @return string - */ - public function getAccessKeySecret() - { - return $this->accessKeySecret; - } - - /** - * @return string - */ - public function __toString() - { - return "$this->accessKeyId#$this->accessKeySecret"; - } - - /** - * @return ShaHmac1Signature - */ - public function getSignature() - { - return new ShaHmac1Signature(); - } - - public function getSecurityToken() - { - return ''; - } -} diff --git a/vendor/alibabacloud/credentials/src/BearerTokenCredential.php b/vendor/alibabacloud/credentials/src/BearerTokenCredential.php deleted file mode 100644 index fb57430..0000000 --- a/vendor/alibabacloud/credentials/src/BearerTokenCredential.php +++ /dev/null @@ -1,53 +0,0 @@ -bearerToken = $bearerToken; - } - - /** - * @return string - */ - public function getBearerToken() - { - return $this->bearerToken; - } - - /** - * @return string - */ - public function __toString() - { - return "bearerToken#$this->bearerToken"; - } - - /** - * @return BearerTokenSignature - */ - public function getSignature() - { - return new BearerTokenSignature(); - } -} diff --git a/vendor/alibabacloud/credentials/src/Credential.php b/vendor/alibabacloud/credentials/src/Credential.php deleted file mode 100644 index 5ff5859..0000000 --- a/vendor/alibabacloud/credentials/src/Credential.php +++ /dev/null @@ -1,182 +0,0 @@ - AccessKeyCredential::class, - 'sts' => StsCredential::class, - 'ecs_ram_role' => EcsRamRoleCredential::class, - 'ram_role_arn' => RamRoleArnCredential::class, - 'rsa_key_pair' => RsaKeyPairCredential::class, - ]; - - /** - * @var AccessKeyCredential|BearerTokenCredential|EcsRamRoleCredential|RamRoleArnCredential|RsaKeyPairCredential - */ - protected $credential; - - /** - * @var string - */ - protected $type; - - /** - * Credential constructor. - * - * @param array|Config $config - * - * @throws ReflectionException - */ - public function __construct($config = []) - { - if ($config instanceof Config) { - $config = $this->parse($config); - } - if ($config !== []) { - $this->config = array_change_key_case($config); - $this->parseConfig(); - } else { - $this->credential = Credentials::get()->getCredential(); - } - } - - /** - * @param Config $config - * - * @return array - */ - private function parse($config) - { - $config = get_object_vars($config); - $res = []; - foreach ($config as $key => $value) { - $res[$this->toUnderScore($key)] = $value; - } - return $res; - } - - private function toUnderScore($str) - { - $dstr = preg_replace_callback('/([A-Z]+)/', function ($matchs) { - return '_' . strtolower($matchs[0]); - }, $str); - return trim(preg_replace('/_{2,}/', '_', $dstr), '_'); - } - - /** - * @throws ReflectionException - */ - private function parseConfig() - { - if (!isset($this->config['type'])) { - throw new InvalidArgumentException('Missing required type option'); - } - - $this->type = $this->config['type']; - if (!isset($this->types[$this->type])) { - throw new InvalidArgumentException( - 'Invalid type option, support: ' . - implode(', ', array_keys($this->types)) - ); - } - - $class = new ReflectionClass($this->types[$this->type]); - $parameters = []; - /** - * @var $parameter ReflectionParameter - */ - foreach ($class->getConstructor()->getParameters() as $parameter) { - $parameters[] = $this->getValue($parameter); - } - - $this->credential = $class->newInstance(...$parameters); - } - - /** - * @param ReflectionParameter $parameter - * - * @return string|array - * @throws ReflectionException - */ - protected function getValue(ReflectionParameter $parameter) - { - if ($parameter->name === 'config' || $parameter->name === 'credential') { - return $this->config; - } - - foreach ($this->config as $key => $value) { - if (strtolower($parameter->name) === $key) { - return $value; - } - } - - if ($parameter->isDefaultValueAvailable()) { - return $parameter->getDefaultValue(); - } - - throw new InvalidArgumentException("Missing required {$parameter->name} option in config for {$this->type}"); - } - - /** - * @return AccessKeyCredential|BearerTokenCredential|EcsRamRoleCredential|RamRoleArnCredential|RsaKeyPairCredential - */ - public function getCredential() - { - return $this->credential; - } - - /** - * @return array - */ - public function getConfig() - { - return $this->config; - } - - /** - * @return string - */ - public function getType() - { - return $this->type; - } - - - /** - * @param string $name - * @param array $arguments - * - * @return mixed - */ - public function __call($name, $arguments) - { - return $this->credential->$name($arguments); - } -} diff --git a/vendor/alibabacloud/credentials/src/Credential/Config.php b/vendor/alibabacloud/credentials/src/Credential/Config.php deleted file mode 100644 index 3fa1608..0000000 --- a/vendor/alibabacloud/credentials/src/Credential/Config.php +++ /dev/null @@ -1,50 +0,0 @@ - $v) { - $this->{$k} = $v; - } - } -} diff --git a/vendor/alibabacloud/credentials/src/Credentials.php b/vendor/alibabacloud/credentials/src/Credentials.php deleted file mode 100644 index 11e68ab..0000000 --- a/vendor/alibabacloud/credentials/src/Credentials.php +++ /dev/null @@ -1,102 +0,0 @@ -roleName = $role_name; - } - - /** - * @return string - * @throws GuzzleException - * @throws Exception - */ - public function getRoleName() - { - if ($this->roleName !== null) { - return $this->roleName; - } - - $this->roleName = $this->getRoleNameFromMeta(); - - return $this->roleName; - } - - /** - * @return string - * @throws Exception - */ - public function getRoleNameFromMeta() - { - $options = [ - 'http_errors' => false, - 'timeout' => 1, - 'connect_timeout' => 1, - ]; - - $result = Request::createClient()->request( - 'GET', - 'http://100.100.100.200/latest/meta-data/ram/security-credentials/', - $options - ); - - if ($result->getStatusCode() === 404) { - throw new InvalidArgumentException('The role name was not found in the instance'); - } - - if ($result->getStatusCode() !== 200) { - throw new RuntimeException('Error retrieving credentials from result: ' . $result->getBody()); - } - - $role_name = (string)$result; - if (!$role_name) { - throw new RuntimeException('Error retrieving credentials from result is empty'); - } - - return $role_name; - } - - /** - * @return string - */ - public function __toString() - { - return "roleName#$this->roleName"; - } - - /** - * @return ShaHmac1Signature - */ - public function getSignature() - { - return new ShaHmac1Signature(); - } - - /** - * @return string - * @throws Exception - * @throws GuzzleException - */ - public function getAccessKeyId() - { - return $this->getSessionCredential()->getAccessKeyId(); - } - - /** - * @return StsCredential - * @throws Exception - * @throws GuzzleException - */ - protected function getSessionCredential() - { - return (new EcsRamRoleProvider($this))->get(); - } - - /** - * @return string - * @throws Exception - * @throws GuzzleException - */ - public function getAccessKeySecret() - { - return $this->getSessionCredential()->getAccessKeySecret(); - } - - /** - * @return string - * @throws Exception - * @throws GuzzleException - */ - public function getSecurityToken() - { - return $this->getSessionCredential()->getSecurityToken(); - } - - /** - * @return int - * @throws Exception - * @throws GuzzleException - */ - public function getExpiration() - { - return $this->getSessionCredential()->getExpiration(); - } -} diff --git a/vendor/alibabacloud/credentials/src/Filter.php b/vendor/alibabacloud/credentials/src/Filter.php deleted file mode 100644 index d17ec4c..0000000 --- a/vendor/alibabacloud/credentials/src/Filter.php +++ /dev/null @@ -1,134 +0,0 @@ - $value) { - if (is_int($key)) { - $result[] = $value; - continue; - } - - if (isset($result[$key]) && is_array($result[$key])) { - $result[$key] = self::merge( - [$result[$key], $value] - ); - continue; - } - - $result[$key] = $value; - } - } - - return $result; - } - - /** - * @param $filename - * - * @return bool - */ - public static function inOpenBasedir($filename) - { - $open_basedir = ini_get('open_basedir'); - if (!$open_basedir) { - return true; - } - - $dirs = explode(PATH_SEPARATOR, $open_basedir); - - return empty($dirs) || self::inDir($filename, $dirs); - } - - /** - * @param string $filename - * @param array $dirs - * - * @return bool - */ - public static function inDir($filename, array $dirs) - { - foreach ($dirs as $dir) { - if ($dir[strlen($dir) - 1] !== DIRECTORY_SEPARATOR) { - $dir .= DIRECTORY_SEPARATOR; - } - - if (0 === strpos($filename, $dir)) { - return true; - } - } - - return false; - } - - /** - * @return bool - */ - public static function isWindows() - { - return PATH_SEPARATOR === ';'; - } - - /** - * @param $key - * - * @return bool|mixed - */ - public static function envNotEmpty($key) - { - $value = self::env($key, false); - if ($value) { - return $value; - } - - return false; - } - - /** - * Gets the value of an environment variable. - * - * @param string $key - * @param mixed $default - * - * @return mixed - */ - public static function env($key, $default = null) - { - $value = getenv($key); - - if ($value === false) { - return self::value($default); - } - - if (self::envSubstr($value)) { - return substr($value, 1, -1); - } - - return self::envConversion($value); - } - - /** - * Return the default value of the given value. - * - * @param mixed $value - * - * @return mixed - */ - public static function value($value) - { - return $value instanceof Closure ? $value() : $value; - } - - /** - * @param $value - * - * @return bool - */ - public static function envSubstr($value) - { - return ($valueLength = strlen($value)) > 1 - && strpos($value, '"') === 0 - && $value[$valueLength - 1] === '"'; - } - - /** - * @param $value - * - * @return bool|string|null - */ - public static function envConversion($value) - { - $key = strtolower($value); - - if ($key === 'null' || $key === '(null)') { - return null; - } - - $list = [ - 'true' => true, - '(true)' => true, - 'false' => false, - '(false)' => false, - 'empty' => '', - '(empty)' => '', - ]; - - return isset($list[$key]) ? $list[$key] : $value; - } - - /** - * Gets the environment's HOME directory. - * - * @return null|string - */ - public static function getHomeDirectory() - { - if (getenv('HOME')) { - return getenv('HOME'); - } - - return (getenv('HOMEDRIVE') && getenv('HOMEPATH')) - ? getenv('HOMEDRIVE') . getenv('HOMEPATH') - : null; - } - - /** - * @param mixed ...$parameters - * - * @codeCoverageIgnore - */ - public static function dd(...$parameters) - { - dump(...$parameters); - exit; - } -} diff --git a/vendor/alibabacloud/credentials/src/MockTrait.php b/vendor/alibabacloud/credentials/src/MockTrait.php deleted file mode 100644 index a590ac7..0000000 --- a/vendor/alibabacloud/credentials/src/MockTrait.php +++ /dev/null @@ -1,98 +0,0 @@ - 'access_key', - 'access_key_id' => $accessKeyId, - 'access_key_secret' => $accessKeySecret, - ] - ); - } - }; - } - - /** - * @return string - */ - public static function getDefaultName() - { - $name = Helper::envNotEmpty('ALIBABA_CLOUD_PROFILE'); - - if ($name) { - return $name; - } - - return 'default'; - } - - /** - * @return Closure - */ - public static function ini() - { - return static function () { - $filename = Helper::envNotEmpty('ALIBABA_CLOUD_CREDENTIALS_FILE'); - if (!$filename) { - $filename = self::getDefaultFile(); - } - - if (!Helper::inOpenBasedir($filename)) { - return; - } - - if ($filename !== self::getDefaultFile() && (!\is_readable($filename) || !\is_file($filename))) { - throw new RuntimeException( - 'Credentials file is not readable: ' . $filename - ); - } - - $file_array = \parse_ini_file($filename, true); - - if (\is_array($file_array) && !empty($file_array)) { - foreach (\array_change_key_case($file_array) as $name => $configures) { - Credentials::set($name, $configures); - } - } - }; - } - - /** - * Get the default credential file. - * - * @return string - */ - public static function getDefaultFile() - { - return Helper::getHomeDirectory() . - DIRECTORY_SEPARATOR . - '.alibabacloud' . - DIRECTORY_SEPARATOR . - 'credentials'; - } - - /** - * @return Closure - */ - public static function instance() - { - return static function () { - $instance = Helper::envNotEmpty('ALIBABA_CLOUD_ECS_METADATA'); - if ($instance) { - Credentials::set( - self::getDefaultName(), - [ - 'type' => 'ecs_ram_role', - 'role_name' => $instance, - ] - ); - } - }; - } -} diff --git a/vendor/alibabacloud/credentials/src/Providers/EcsRamRoleProvider.php b/vendor/alibabacloud/credentials/src/Providers/EcsRamRoleProvider.php deleted file mode 100644 index 828bdad..0000000 --- a/vendor/alibabacloud/credentials/src/Providers/EcsRamRoleProvider.php +++ /dev/null @@ -1,94 +0,0 @@ -getCredentialsInCache(); - - if ($result === null) { - $result = $this->request(); - - if (!isset($result['AccessKeyId'], $result['AccessKeySecret'], $result['SecurityToken'])) { - throw new RuntimeException($this->error); - } - - $this->cache($result->toArray()); - } - - return new StsCredential( - $result['AccessKeyId'], - $result['AccessKeySecret'], - strtotime($result['Expiration']), - $result['SecurityToken'] - ); - } - - /** - * Get credentials by request. - * - * @return ResponseInterface - * @throws Exception - * @throws GuzzleException - */ - public function request() - { - $credential = $this->credential; - $url = $this->uri . $credential->getRoleName(); - - $options = [ - 'http_errors' => false, - 'timeout' => 1, - 'connect_timeout' => 1, - ]; - - $result = Request::createClient()->request('GET', $url, $options); - - if ($result->getStatusCode() === 404) { - $message = 'The role was not found in the instance'; - throw new InvalidArgumentException($message); - } - - if ($result->getStatusCode() !== 200) { - throw new RuntimeException('Error retrieving credentials from result: ' . $result->toJson()); - } - - return $result; - } -} diff --git a/vendor/alibabacloud/credentials/src/Providers/Provider.php b/vendor/alibabacloud/credentials/src/Providers/Provider.php deleted file mode 100644 index e1e869d..0000000 --- a/vendor/alibabacloud/credentials/src/Providers/Provider.php +++ /dev/null @@ -1,82 +0,0 @@ -credential = $credential; - $this->config = $config; - } - - /** - * Get the credentials from the cache in the validity period. - * - * @return array|null - */ - public function getCredentialsInCache() - { - if (isset(self::$credentialsCache[(string)$this->credential])) { - $result = self::$credentialsCache[(string)$this->credential]; - if (\strtotime($result['Expiration']) - \time() >= $this->expirationSlot) { - return $result; - } - } - - return null; - } - - /** - * Cache credentials. - * - * @param array $credential - */ - protected function cache(array $credential) - { - self::$credentialsCache[(string)$this->credential] = $credential; - } -} diff --git a/vendor/alibabacloud/credentials/src/Providers/RamRoleArnProvider.php b/vendor/alibabacloud/credentials/src/Providers/RamRoleArnProvider.php deleted file mode 100644 index c6a8729..0000000 --- a/vendor/alibabacloud/credentials/src/Providers/RamRoleArnProvider.php +++ /dev/null @@ -1,49 +0,0 @@ -getCredentialsInCache(); - - if (null === $credential) { - $result = (new AssumeRole($this->credential))->request(); - - if ($result->getStatusCode() !== 200) { - throw new RuntimeException(isset($result['Message']) ? $result['Message'] : (string)$result->getBody()); - } - - if (!isset($result['Credentials']['AccessKeyId'], - $result['Credentials']['AccessKeySecret'], - $result['Credentials']['SecurityToken'])) { - throw new RuntimeException($this->error); - } - - $credential = $result['Credentials']; - $this->cache($credential); - } - - return new StsCredential( - $credential['AccessKeyId'], - $credential['AccessKeySecret'], - strtotime($credential['Expiration']), - $credential['SecurityToken'] - ); - } -} diff --git a/vendor/alibabacloud/credentials/src/Providers/RsaKeyPairProvider.php b/vendor/alibabacloud/credentials/src/Providers/RsaKeyPairProvider.php deleted file mode 100644 index c2d03fc..0000000 --- a/vendor/alibabacloud/credentials/src/Providers/RsaKeyPairProvider.php +++ /dev/null @@ -1,53 +0,0 @@ -getCredentialsInCache(); - - if ($credential === null) { - $result = (new GenerateSessionAccessKey($this->credential))->request(); - - if ($result->getStatusCode() !== 200) { - throw new RuntimeException(isset($result['Message']) ? $result['Message'] : (string)$result->getBody()); - } - - if (!isset($result['SessionAccessKey']['SessionAccessKeyId'], - $result['SessionAccessKey']['SessionAccessKeySecret'])) { - throw new RuntimeException($this->error); - } - - $credential = $result['SessionAccessKey']; - $this->cache($credential); - } - - return new StsCredential( - $credential['SessionAccessKeyId'], - $credential['SessionAccessKeySecret'], - strtotime($credential['Expiration']) - ); - } -} diff --git a/vendor/alibabacloud/credentials/src/RamRoleArnCredential.php b/vendor/alibabacloud/credentials/src/RamRoleArnCredential.php deleted file mode 100644 index b82c608..0000000 --- a/vendor/alibabacloud/credentials/src/RamRoleArnCredential.php +++ /dev/null @@ -1,218 +0,0 @@ -filterParameters($credential); - $this->filterPolicy($credential); - - Filter::accessKey($credential['access_key_id'], $credential['access_key_secret']); - - $this->config = $config; - $this->accessKeyId = $credential['access_key_id']; - $this->accessKeySecret = $credential['access_key_secret']; - $this->roleArn = $credential['role_arn']; - $this->roleSessionName = $credential['role_session_name']; - } - - /** - * @param array $credential - */ - private function filterParameters(array $credential) - { - if (!isset($credential['access_key_id'])) { - throw new InvalidArgumentException('Missing required access_key_id option in config for ram_role_arn'); - } - - if (!isset($credential['access_key_secret'])) { - throw new InvalidArgumentException('Missing required access_key_secret option in config for ram_role_arn'); - } - - if (!isset($credential['role_arn'])) { - throw new InvalidArgumentException('Missing required role_arn option in config for ram_role_arn'); - } - - if (!isset($credential['role_session_name'])) { - throw new InvalidArgumentException('Missing required role_session_name option in config for ram_role_arn'); - } - } - - /** - * @param array $credential - */ - private function filterPolicy(array $credential) - { - if (isset($credential['policy'])) { - if (is_string($credential['policy'])) { - $this->policy = $credential['policy']; - } - - if (is_array($credential['policy'])) { - $this->policy = json_encode($credential['policy']); - } - } - } - - /** - * @return array - */ - public function getConfig() - { - return $this->config; - } - - /** - * @return string - */ - public function getRoleArn() - { - return $this->roleArn; - } - - /** - * @return string - */ - public function getRoleSessionName() - { - return $this->roleSessionName; - } - - /** - * @return string - */ - public function getPolicy() - { - return $this->policy; - } - - /** - * @return string - */ - public function __toString() - { - return "$this->accessKeyId#$this->accessKeySecret#$this->roleArn#$this->roleSessionName"; - } - - /** - * @return ShaHmac1Signature - */ - public function getSignature() - { - return new ShaHmac1Signature(); - } - - /** - * @return string - */ - public function getOriginalAccessKeyId() - { - return $this->accessKeyId; - } - - /** - * @return string - */ - public function getOriginalAccessKeySecret() - { - return $this->accessKeySecret; - } - - /** - * @return string - * @throws Exception - * @throws GuzzleException - */ - public function getAccessKeyId() - { - return $this->getSessionCredential()->getAccessKeyId(); - } - - /** - * @return StsCredential - * @throws Exception - * @throws GuzzleException - */ - protected function getSessionCredential() - { - return (new RamRoleArnProvider($this))->get(); - } - - /** - * @return string - * @throws Exception - * @throws GuzzleException - */ - public function getAccessKeySecret() - { - return $this->getSessionCredential()->getAccessKeySecret(); - } - - /** - * @return string - * @throws Exception - * @throws GuzzleException - */ - public function getSecurityToken() - { - return $this->getSessionCredential()->getSecurityToken(); - } - - /** - * @return string - * @throws Exception - * @throws GuzzleException - */ - public function getExpiration() - { - return $this->getSessionCredential()->getExpiration(); - } -} diff --git a/vendor/alibabacloud/credentials/src/Request/AssumeRole.php b/vendor/alibabacloud/credentials/src/Request/AssumeRole.php deleted file mode 100644 index 962a733..0000000 --- a/vendor/alibabacloud/credentials/src/Request/AssumeRole.php +++ /dev/null @@ -1,37 +0,0 @@ -signature = new ShaHmac1Signature(); - $this->credential = $arnCredential; - $this->uri = $this->uri->withHost('sts.aliyuncs.com'); - $this->options['verify'] = false; - $this->options['query']['RoleArn'] = $arnCredential->getRoleArn(); - $this->options['query']['RoleSessionName'] = $arnCredential->getRoleSessionName(); - $this->options['query']['DurationSeconds'] = Provider::DURATION_SECONDS; - $this->options['query']['AccessKeyId'] = $this->credential->getOriginalAccessKeyId(); - $this->options['query']['Version'] = '2015-04-01'; - $this->options['query']['Action'] = 'AssumeRole'; - $this->options['query']['RegionId'] = 'cn-hangzhou'; - if ($arnCredential->getPolicy()) { - $this->options['query']['Policy'] = $arnCredential->getPolicy(); - } - } -} diff --git a/vendor/alibabacloud/credentials/src/Request/GenerateSessionAccessKey.php b/vendor/alibabacloud/credentials/src/Request/GenerateSessionAccessKey.php deleted file mode 100644 index 35db585..0000000 --- a/vendor/alibabacloud/credentials/src/Request/GenerateSessionAccessKey.php +++ /dev/null @@ -1,33 +0,0 @@ -signature = new ShaHmac256WithRsaSignature(); - $this->credential = $credential; - $this->uri = $this->uri->withHost('sts.ap-northeast-1.aliyuncs.com'); - $this->options['verify'] = false; - $this->options['query']['Version'] = '2015-04-01'; - $this->options['query']['Action'] = 'GenerateSessionAccessKey'; - $this->options['query']['RegionId'] = 'cn-hangzhou'; - $this->options['query']['AccessKeyId'] = $credential->getPublicKeyId(); - $this->options['query']['PublicKeyId'] = $credential->getPublicKeyId(); - $this->options['query']['DurationSeconds'] = Provider::DURATION_SECONDS; - } -} diff --git a/vendor/alibabacloud/credentials/src/Request/Request.php b/vendor/alibabacloud/credentials/src/Request/Request.php deleted file mode 100644 index 1bf1418..0000000 --- a/vendor/alibabacloud/credentials/src/Request/Request.php +++ /dev/null @@ -1,155 +0,0 @@ -uri = (new Uri())->withScheme('https'); - $this->options['http_errors'] = false; - $this->options['connect_timeout'] = self::CONNECT_TIMEOUT; - $this->options['timeout'] = self::TIMEOUT; - - // Turn on debug mode based on environment variable. - if (strtolower(Helper::env('DEBUG')) === 'sdk') { - $this->options['debug'] = true; - } - } - - /** - * @return ResponseInterface - * @throws Exception - */ - public function request() - { - $this->options['query']['Format'] = 'JSON'; - $this->options['query']['SignatureMethod'] = $this->signature->getMethod(); - $this->options['query']['SignatureVersion'] = $this->signature->getVersion(); - $this->options['query']['SignatureNonce'] = self::uuid(json_encode($this->options['query'])); - $this->options['query']['Timestamp'] = gmdate('Y-m-d\TH:i:s\Z'); - $this->options['query']['Signature'] = $this->signature->sign( - self::signString('GET', $this->options['query']), - $this->credential->getOriginalAccessKeySecret() . '&' - ); - return self::createClient()->request('GET', (string)$this->uri, $this->options); - } - - /** - * @param string $salt - * - * @return string - */ - public static function uuid($salt) - { - return md5($salt . uniqid(md5(microtime(true)), true)); - } - - /** - * @param string $method - * @param array $parameters - * - * @return string - */ - public static function signString($method, array $parameters) - { - ksort($parameters); - $canonicalized = ''; - foreach ($parameters as $key => $value) { - $canonicalized .= '&' . self::percentEncode($key) . '=' . self::percentEncode($value); - } - - return $method . '&%2F&' . self::percentEncode(substr($canonicalized, 1)); - } - - /** - * @param string $string - * - * @return null|string|string[] - */ - private static function percentEncode($string) - { - $result = rawurlencode($string); - $result = str_replace(['+', '*'], ['%20', '%2A'], $result); - $result = preg_replace('/%7E/', '~', $result); - - return $result; - } - - /** - * @return Client - * @throws Exception - */ - public static function createClient() - { - if (Credentials::hasMock()) { - $stack = HandlerStack::create(Credentials::getMock()); - } else { - $stack = HandlerStack::create(); - } - - $stack->push(Middleware::mapResponse(static function (ResponseInterface $response) { - return new Response($response); - })); - - self::$config['handler'] = $stack; - - return new Client(self::$config); - } -} diff --git a/vendor/alibabacloud/credentials/src/RsaKeyPairCredential.php b/vendor/alibabacloud/credentials/src/RsaKeyPairCredential.php deleted file mode 100644 index bb47f6b..0000000 --- a/vendor/alibabacloud/credentials/src/RsaKeyPairCredential.php +++ /dev/null @@ -1,158 +0,0 @@ -publicKeyId = $public_key_id; - $this->config = $config; - try { - $this->privateKey = file_get_contents($private_key_file); - } catch (Exception $exception) { - throw new InvalidArgumentException($exception->getMessage()); - } - } - - /** - * @return array - */ - public function getConfig() - { - return $this->config; - } - - /** - * @return string - */ - public function getOriginalAccessKeyId() - { - return $this->getPublicKeyId(); - } - - /** - * @return string - */ - public function getPublicKeyId() - { - return $this->publicKeyId; - } - - /** - * @return string - */ - public function getOriginalAccessKeySecret() - { - return $this->getPrivateKey(); - } - - /** - * @return mixed - */ - public function getPrivateKey() - { - return $this->privateKey; - } - - /** - * @return string - */ - public function __toString() - { - return "publicKeyId#$this->publicKeyId"; - } - - /** - * @return ShaHmac1Signature - */ - public function getSignature() - { - return new ShaHmac1Signature(); - } - - /** - * @return string - * @throws Exception - * @throws GuzzleException - */ - public function getAccessKeyId() - { - return $this->getSessionCredential()->getAccessKeyId(); - } - - /** - * @return StsCredential - * @throws Exception - * @throws GuzzleException - */ - protected function getSessionCredential() - { - return (new RsaKeyPairProvider($this))->get(); - } - - /** - * @return string - * @throws Exception - * @throws GuzzleException - */ - public function getAccessKeySecret() - { - return $this->getSessionCredential()->getAccessKeySecret(); - } - - /** - * @return string - * @throws Exception - * @throws GuzzleException - */ - public function getSecurityToken() - { - return $this->getSessionCredential()->getSecurityToken(); - } - - /** - * @return int - * @throws Exception - * @throws GuzzleException - */ - public function getExpiration() - { - return $this->getSessionCredential()->getExpiration(); - } -} diff --git a/vendor/alibabacloud/credentials/src/Signature/BearerTokenSignature.php b/vendor/alibabacloud/credentials/src/Signature/BearerTokenSignature.php deleted file mode 100644 index 1d67a80..0000000 --- a/vendor/alibabacloud/credentials/src/Signature/BearerTokenSignature.php +++ /dev/null @@ -1,47 +0,0 @@ -getMessage() - ); - } - - return base64_encode($binarySignature); - } -} diff --git a/vendor/alibabacloud/credentials/src/Signature/SignatureInterface.php b/vendor/alibabacloud/credentials/src/Signature/SignatureInterface.php deleted file mode 100644 index 9dfb73b..0000000 --- a/vendor/alibabacloud/credentials/src/Signature/SignatureInterface.php +++ /dev/null @@ -1,34 +0,0 @@ -accessKeyId = $access_key_id; - $this->accessKeySecret = $access_key_secret; - $this->expiration = $expiration; - $this->securityToken = $security_token; - } - - /** - * @return int - */ - public function getExpiration() - { - return $this->expiration; - } - - /** - * @return string - */ - public function getAccessKeyId() - { - return $this->accessKeyId; - } - - /** - * @return string - */ - public function getAccessKeySecret() - { - return $this->accessKeySecret; - } - - /** - * @return string - */ - public function getSecurityToken() - { - return $this->securityToken; - } - - /** - * @return string - */ - public function __toString() - { - return "$this->accessKeyId#$this->accessKeySecret#$this->securityToken"; - } - - /** - * @return ShaHmac1Signature - */ - public function getSignature() - { - return new ShaHmac1Signature(); - } -} diff --git a/vendor/alibabacloud/darabonba-openapi/.gitignore b/vendor/alibabacloud/darabonba-openapi/.gitignore deleted file mode 100644 index 89c7aa5..0000000 --- a/vendor/alibabacloud/darabonba-openapi/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -composer.phar -/vendor/ - -# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control -# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -composer.lock - -.vscode/ -.idea -.DS_Store - -cache/ -*.cache -runtime/ -.php_cs.cache diff --git a/vendor/alibabacloud/darabonba-openapi/.php_cs.dist b/vendor/alibabacloud/darabonba-openapi/.php_cs.dist deleted file mode 100644 index 8617ec2..0000000 --- a/vendor/alibabacloud/darabonba-openapi/.php_cs.dist +++ /dev/null @@ -1,65 +0,0 @@ -setRiskyAllowed(true) - ->setIndent(' ') - ->setRules([ - '@PSR2' => true, - '@PhpCsFixer' => true, - '@Symfony:risky' => true, - 'concat_space' => ['spacing' => 'one'], - 'array_syntax' => ['syntax' => 'short'], - 'array_indentation' => true, - 'combine_consecutive_unsets' => true, - 'method_separation' => true, - 'single_quote' => true, - 'declare_equal_normalize' => true, - 'function_typehint_space' => true, - 'hash_to_slash_comment' => true, - 'include' => true, - 'lowercase_cast' => true, - 'no_multiline_whitespace_before_semicolons' => true, - 'no_leading_import_slash' => true, - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_spaces_around_offset' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unused_imports' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'object_operator_without_whitespace' => true, - 'single_blank_line_before_namespace' => true, - 'single_class_element_per_statement' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'whitespace_after_comma_in_array' => true, - 'no_extra_consecutive_blank_lines' => [ - 'curly_brace_block', - 'extra', - 'parenthesis_brace_block', - 'square_brace_block', - 'throw', - 'use', - ], - 'binary_operator_spaces' => [ - 'align_double_arrow' => true, - 'align_equals' => true, - ], - 'braces' => [ - 'allow_single_line_closure' => true, - ], - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude('vendor') - ->exclude('tests') - ->in(__DIR__) - ); diff --git a/vendor/alibabacloud/darabonba-openapi/README-CN.md b/vendor/alibabacloud/darabonba-openapi/README-CN.md deleted file mode 100644 index b70255c..0000000 --- a/vendor/alibabacloud/darabonba-openapi/README-CN.md +++ /dev/null @@ -1,31 +0,0 @@ -[English](README.md) | 简体中文 - -![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg) - -## Alibaba Cloud OpenApi Client - -## 安装 - -### Composer - -```bash -composer require alibabacloud/darabonba-openapi -``` - -## 问题 - -[提交 Issue](https://github.com/aliyun/darabonba-openapi/issues/new),不符合指南的问题可能会立即关闭。 - -## 发行说明 - -每个版本的详细更改记录在[发行说明](./ChangeLog.txt)中。 - -## 相关 - -* [最新源码](https://github.com/aliyun/darabonba-openapi) - -## 许可证 - -[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) - -Copyright (c) 2009-present, Alibaba Cloud All rights reserved. diff --git a/vendor/alibabacloud/darabonba-openapi/README.md b/vendor/alibabacloud/darabonba-openapi/README.md deleted file mode 100644 index 9770627..0000000 --- a/vendor/alibabacloud/darabonba-openapi/README.md +++ /dev/null @@ -1,31 +0,0 @@ -English | [简体中文](README-CN.md) - -![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg) - -## Alibaba Cloud OpenApi Client - -## Installation - -### Composer - -```bash -composer require alibabacloud/darabonba-openapi -``` - -## Issues - -[Opening an Issue](https://github.com/aliyun/darabonba-openapi/issues/new), Issues not conforming to the guidelines may be closed immediately. - -## Changelog - -Detailed changes for each release are documented in the [release notes](./ChangeLog.txt). - -## References - -* [Latest Release](https://github.com/aliyun/darabonba-openapi) - -## License - -[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) - -Copyright (c) 2009-present, Alibaba Cloud All rights reserved. diff --git a/vendor/alibabacloud/darabonba-openapi/autoload.php b/vendor/alibabacloud/darabonba-openapi/autoload.php deleted file mode 100644 index 526c188..0000000 --- a/vendor/alibabacloud/darabonba-openapi/autoload.php +++ /dev/null @@ -1,15 +0,0 @@ -5.5", - "alibabacloud/tea-utils": "^0.2.0", - "alibabacloud/credentials": "^1.1", - "alibabacloud/openapi-util": "^0.1.9" - }, - "autoload": { - "psr-4": { - "Darabonba\\OpenApi\\": "src" - } - }, - "scripts": { - "fixer": "php-cs-fixer fix ./" - }, - "config": { - "sort-packages": true, - "preferred-install": "dist", - "optimize-autoloader": true - }, - "prefer-stable": true -} \ No newline at end of file diff --git a/vendor/alibabacloud/darabonba-openapi/src/Models/Config.php b/vendor/alibabacloud/darabonba-openapi/src/Models/Config.php deleted file mode 100644 index 81ccf1c..0000000 --- a/vendor/alibabacloud/darabonba-openapi/src/Models/Config.php +++ /dev/null @@ -1,387 +0,0 @@ - '', - 'accessKeySecret' => '', - 'securityToken' => '', - 'protocol' => 'http', - 'regionId' => '', - 'readTimeout' => '', - 'connectTimeout' => '', - 'httpProxy' => '', - 'httpsProxy' => '', - 'credential' => '', - 'endpoint' => '', - 'noProxy' => '', - 'maxIdleConns' => '', - 'network' => '', - 'userAgent' => '', - 'suffix' => '', - 'socks5Proxy' => '', - 'socks5NetWork' => '', - 'endpointType' => '', - 'openPlatformEndpoint' => '', - 'type' => '', - 'signatureAlgorithm' => '', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->accessKeyId) { - $res['accessKeyId'] = $this->accessKeyId; - } - if (null !== $this->accessKeySecret) { - $res['accessKeySecret'] = $this->accessKeySecret; - } - if (null !== $this->securityToken) { - $res['securityToken'] = $this->securityToken; - } - if (null !== $this->protocol) { - $res['protocol'] = $this->protocol; - } - if (null !== $this->regionId) { - $res['regionId'] = $this->regionId; - } - if (null !== $this->readTimeout) { - $res['readTimeout'] = $this->readTimeout; - } - if (null !== $this->connectTimeout) { - $res['connectTimeout'] = $this->connectTimeout; - } - if (null !== $this->httpProxy) { - $res['httpProxy'] = $this->httpProxy; - } - if (null !== $this->httpsProxy) { - $res['httpsProxy'] = $this->httpsProxy; - } - if (null !== $this->credential) { - $res['credential'] = null !== $this->credential ? $this->credential->toMap() : null; - } - if (null !== $this->endpoint) { - $res['endpoint'] = $this->endpoint; - } - if (null !== $this->noProxy) { - $res['noProxy'] = $this->noProxy; - } - if (null !== $this->maxIdleConns) { - $res['maxIdleConns'] = $this->maxIdleConns; - } - if (null !== $this->network) { - $res['network'] = $this->network; - } - if (null !== $this->userAgent) { - $res['userAgent'] = $this->userAgent; - } - if (null !== $this->suffix) { - $res['suffix'] = $this->suffix; - } - if (null !== $this->socks5Proxy) { - $res['socks5Proxy'] = $this->socks5Proxy; - } - if (null !== $this->socks5NetWork) { - $res['socks5NetWork'] = $this->socks5NetWork; - } - if (null !== $this->endpointType) { - $res['endpointType'] = $this->endpointType; - } - if (null !== $this->openPlatformEndpoint) { - $res['openPlatformEndpoint'] = $this->openPlatformEndpoint; - } - if (null !== $this->type) { - $res['type'] = $this->type; - } - if (null !== $this->signatureAlgorithm) { - $res['signatureAlgorithm'] = $this->signatureAlgorithm; - } - - return $res; - } - - /** - * @param array $map - * - * @return Config - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['accessKeyId'])) { - $model->accessKeyId = $map['accessKeyId']; - } - if (isset($map['accessKeySecret'])) { - $model->accessKeySecret = $map['accessKeySecret']; - } - if (isset($map['securityToken'])) { - $model->securityToken = $map['securityToken']; - } - if (isset($map['protocol'])) { - $model->protocol = $map['protocol']; - } - if (isset($map['regionId'])) { - $model->regionId = $map['regionId']; - } - if (isset($map['readTimeout'])) { - $model->readTimeout = $map['readTimeout']; - } - if (isset($map['connectTimeout'])) { - $model->connectTimeout = $map['connectTimeout']; - } - if (isset($map['httpProxy'])) { - $model->httpProxy = $map['httpProxy']; - } - if (isset($map['httpsProxy'])) { - $model->httpsProxy = $map['httpsProxy']; - } - if (isset($map['credential'])) { - $model->credential = Credential::fromMap($map['credential']); - } - if (isset($map['endpoint'])) { - $model->endpoint = $map['endpoint']; - } - if (isset($map['noProxy'])) { - $model->noProxy = $map['noProxy']; - } - if (isset($map['maxIdleConns'])) { - $model->maxIdleConns = $map['maxIdleConns']; - } - if (isset($map['network'])) { - $model->network = $map['network']; - } - if (isset($map['userAgent'])) { - $model->userAgent = $map['userAgent']; - } - if (isset($map['suffix'])) { - $model->suffix = $map['suffix']; - } - if (isset($map['socks5Proxy'])) { - $model->socks5Proxy = $map['socks5Proxy']; - } - if (isset($map['socks5NetWork'])) { - $model->socks5NetWork = $map['socks5NetWork']; - } - if (isset($map['endpointType'])) { - $model->endpointType = $map['endpointType']; - } - if (isset($map['openPlatformEndpoint'])) { - $model->openPlatformEndpoint = $map['openPlatformEndpoint']; - } - if (isset($map['type'])) { - $model->type = $map['type']; - } - if (isset($map['signatureAlgorithm'])) { - $model->signatureAlgorithm = $map['signatureAlgorithm']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/darabonba-openapi/src/Models/OpenApiRequest.php b/vendor/alibabacloud/darabonba-openapi/src/Models/OpenApiRequest.php deleted file mode 100644 index 0d92fb6..0000000 --- a/vendor/alibabacloud/darabonba-openapi/src/Models/OpenApiRequest.php +++ /dev/null @@ -1,65 +0,0 @@ -headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->query) { - $res['query'] = $this->query; - } - if (null !== $this->body) { - $res['body'] = $this->body; - } - if (null !== $this->stream) { - $res['stream'] = $this->stream; - } - - return $res; - } - - /** - * @param array $map - * - * @return OpenApiRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['query'])) { - $model->query = $map['query']; - } - if (isset($map['body'])) { - $model->body = $map['body']; - } - if (isset($map['stream'])) { - $model->stream = $map['stream']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/darabonba-openapi/src/Models/Params.php b/vendor/alibabacloud/darabonba-openapi/src/Models/Params.php deleted file mode 100644 index b42cfdf..0000000 --- a/vendor/alibabacloud/darabonba-openapi/src/Models/Params.php +++ /dev/null @@ -1,137 +0,0 @@ -action, true); - Model::validateRequired('version', $this->version, true); - Model::validateRequired('protocol', $this->protocol, true); - Model::validateRequired('pathname', $this->pathname, true); - Model::validateRequired('method', $this->method, true); - Model::validateRequired('authType', $this->authType, true); - Model::validateRequired('bodyType', $this->bodyType, true); - Model::validateRequired('reqBodyType', $this->reqBodyType, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->action) { - $res['action'] = $this->action; - } - if (null !== $this->version) { - $res['version'] = $this->version; - } - if (null !== $this->protocol) { - $res['protocol'] = $this->protocol; - } - if (null !== $this->pathname) { - $res['pathname'] = $this->pathname; - } - if (null !== $this->method) { - $res['method'] = $this->method; - } - if (null !== $this->authType) { - $res['authType'] = $this->authType; - } - if (null !== $this->bodyType) { - $res['bodyType'] = $this->bodyType; - } - if (null !== $this->reqBodyType) { - $res['reqBodyType'] = $this->reqBodyType; - } - if (null !== $this->style) { - $res['style'] = $this->style; - } - - return $res; - } - - /** - * @param array $map - * - * @return Params - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['action'])) { - $model->action = $map['action']; - } - if (isset($map['version'])) { - $model->version = $map['version']; - } - if (isset($map['protocol'])) { - $model->protocol = $map['protocol']; - } - if (isset($map['pathname'])) { - $model->pathname = $map['pathname']; - } - if (isset($map['method'])) { - $model->method = $map['method']; - } - if (isset($map['authType'])) { - $model->authType = $map['authType']; - } - if (isset($map['bodyType'])) { - $model->bodyType = $map['bodyType']; - } - if (isset($map['reqBodyType'])) { - $model->reqBodyType = $map['reqBodyType']; - } - if (isset($map['style'])) { - $model->style = $map['style']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/darabonba-openapi/src/OpenApiClient.php b/vendor/alibabacloud/darabonba-openapi/src/OpenApiClient.php deleted file mode 100644 index c8777c4..0000000 --- a/vendor/alibabacloud/darabonba-openapi/src/OpenApiClient.php +++ /dev/null @@ -1,943 +0,0 @@ - 'ParameterMissing', - 'message' => "'config' can not be unset", - ]); - } - if (!Utils::empty_($config->accessKeyId) && !Utils::empty_($config->accessKeySecret)) { - if (!Utils::empty_($config->securityToken)) { - $config->type = 'sts'; - } else { - $config->type = 'access_key'; - } - $credentialConfig = new Config([ - 'accessKeyId' => $config->accessKeyId, - 'type' => $config->type, - 'accessKeySecret' => $config->accessKeySecret, - 'securityToken' => $config->securityToken, - ]); - $this->_credential = new Credential($credentialConfig); - } elseif (!Utils::isUnset($config->credential)) { - $this->_credential = $config->credential; - } - $this->_endpoint = $config->endpoint; - $this->_endpointType = $config->endpointType; - $this->_protocol = $config->protocol; - $this->_regionId = $config->regionId; - $this->_userAgent = $config->userAgent; - $this->_readTimeout = $config->readTimeout; - $this->_connectTimeout = $config->connectTimeout; - $this->_httpProxy = $config->httpProxy; - $this->_httpsProxy = $config->httpsProxy; - $this->_noProxy = $config->noProxy; - $this->_socks5Proxy = $config->socks5Proxy; - $this->_socks5NetWork = $config->socks5NetWork; - $this->_maxIdleConns = $config->maxIdleConns; - $this->_signatureAlgorithm = $config->signatureAlgorithm; - } - - /** - * Encapsulate the request and invoke the network. - * - * @param string $action api name - * @param string $version product version - * @param string $protocol http or https - * @param string $method e.g. GET - * @param string $authType authorization type e.g. AK - * @param string $bodyType response body type e.g. String - * @param OpenApiRequest $request object of OpenApiRequest - * @param RuntimeOptions $runtime which controls some details of call api, such as retry times - * - * @throws TeaError - * @throws Exception - * @throws TeaUnableRetryError - * - * @return array the response - */ - public function doRPCRequest($action, $version, $protocol, $method, $authType, $bodyType, $request, $runtime) - { - $request->validate(); - $runtime->validate(); - $_runtime = [ - 'timeouted' => 'retry', - 'readTimeout' => Utils::defaultNumber($runtime->readTimeout, $this->_readTimeout), - 'connectTimeout' => Utils::defaultNumber($runtime->connectTimeout, $this->_connectTimeout), - 'httpProxy' => Utils::defaultString($runtime->httpProxy, $this->_httpProxy), - 'httpsProxy' => Utils::defaultString($runtime->httpsProxy, $this->_httpsProxy), - 'noProxy' => Utils::defaultString($runtime->noProxy, $this->_noProxy), - 'maxIdleConns' => Utils::defaultNumber($runtime->maxIdleConns, $this->_maxIdleConns), - 'retry' => [ - 'retryable' => $runtime->autoretry, - 'maxAttempts' => Utils::defaultNumber($runtime->maxAttempts, 3), - ], - 'backoff' => [ - 'policy' => Utils::defaultString($runtime->backoffPolicy, 'no'), - 'period' => Utils::defaultNumber($runtime->backoffPeriod, 1), - ], - 'ignoreSSL' => $runtime->ignoreSSL, - ]; - $_lastRequest = null; - $_lastException = null; - $_now = time(); - $_retryTimes = 0; - while (Tea::allowRetry(@$_runtime['retry'], $_retryTimes, $_now)) { - if ($_retryTimes > 0) { - $_backoffTime = Tea::getBackoffTime(@$_runtime['backoff'], $_retryTimes); - if ($_backoffTime > 0) { - Tea::sleep($_backoffTime); - } - } - $_retryTimes = $_retryTimes + 1; - - try { - $_request = new Request(); - $_request->protocol = Utils::defaultString($this->_protocol, $protocol); - $_request->method = $method; - $_request->pathname = '/'; - $_request->query = Tea::merge([ - 'Action' => $action, - 'Format' => 'json', - 'Version' => $version, - 'Timestamp' => OpenApiUtilClient::getTimestamp(), - 'SignatureNonce' => Utils::getNonce(), - ], $request->query); - $headers = $this->getRpcHeaders(); - if (Utils::isUnset($headers)) { - // endpoint is setted in product client - $_request->headers = [ - 'host' => $this->_endpoint, - 'x-acs-version' => $version, - 'x-acs-action' => $action, - 'user-agent' => $this->getUserAgent(), - ]; - } else { - $_request->headers = Tea::merge([ - 'host' => $this->_endpoint, - 'x-acs-version' => $version, - 'x-acs-action' => $action, - 'user-agent' => $this->getUserAgent(), - ], $headers); - } - if (!Utils::isUnset($request->body)) { - $m = Utils::assertAsMap($request->body); - $tmp = Utils::anyifyMapValue(OpenApiUtilClient::query($m)); - $_request->body = Utils::toFormString($tmp); - $_request->headers['content-type'] = 'application/x-www-form-urlencoded'; - } - if (!Utils::equalString($authType, 'Anonymous')) { - $accessKeyId = $this->getAccessKeyId(); - $accessKeySecret = $this->getAccessKeySecret(); - $securityToken = $this->getSecurityToken(); - if (!Utils::empty_($securityToken)) { - $_request->query['SecurityToken'] = $securityToken; - } - $_request->query['SignatureMethod'] = 'HMAC-SHA1'; - $_request->query['SignatureVersion'] = '1.0'; - $_request->query['AccessKeyId'] = $accessKeyId; - $t = null; - if (!Utils::isUnset($request->body)) { - $t = Utils::assertAsMap($request->body); - } - $signedParam = Tea::merge($_request->query, OpenApiUtilClient::query($t)); - $_request->query['Signature'] = OpenApiUtilClient::getRPCSignature($signedParam, $_request->method, $accessKeySecret); - } - $_lastRequest = $_request; - $_response = Tea::send($_request, $_runtime); - if (Utils::is4xx($_response->statusCode) || Utils::is5xx($_response->statusCode)) { - $_res = Utils::readAsJSON($_response->body); - $err = Utils::assertAsMap($_res); - $requestId = self::defaultAny(@$err['RequestId'], @$err['requestId']); - - throw new TeaError([ - 'code' => '' . (string) (self::defaultAny(@$err['Code'], @$err['code'])) . '', - 'message' => 'code: ' . (string) ($_response->statusCode) . ', ' . (string) (self::defaultAny(@$err['Message'], @$err['message'])) . ' request id: ' . (string) ($requestId) . '', - 'data' => $err, - ]); - } - if (Utils::equalString($bodyType, 'binary')) { - $resp = [ - 'body' => $_response->body, - 'headers' => $_response->headers, - ]; - - return $resp; - } - if (Utils::equalString($bodyType, 'byte')) { - $byt = Utils::readAsBytes($_response->body); - - return [ - 'body' => $byt, - 'headers' => $_response->headers, - ]; - } - if (Utils::equalString($bodyType, 'string')) { - $str = Utils::readAsString($_response->body); - - return [ - 'body' => $str, - 'headers' => $_response->headers, - ]; - } - if (Utils::equalString($bodyType, 'json')) { - $obj = Utils::readAsJSON($_response->body); - $res = Utils::assertAsMap($obj); - - return [ - 'body' => $res, - 'headers' => $_response->headers, - ]; - } - if (Utils::equalString($bodyType, 'array')) { - $arr = Utils::readAsJSON($_response->body); - - return [ - 'body' => $arr, - 'headers' => $_response->headers, - ]; - } - - return [ - 'headers' => $_response->headers, - ]; - } catch (Exception $e) { - if (!($e instanceof TeaError)) { - $e = new TeaError([], $e->getMessage(), $e->getCode(), $e); - } - if (Tea::isRetryable($e)) { - $_lastException = $e; - - continue; - } - - throw $e; - } - } - - throw new TeaUnableRetryError($_lastRequest, $_lastException); - } - - /** - * Encapsulate the request and invoke the network. - * - * @param string $action api name - * @param string $version product version - * @param string $protocol http or https - * @param string $method e.g. GET - * @param string $authType authorization type e.g. AK - * @param string $pathname pathname of every api - * @param string $bodyType response body type e.g. String - * @param OpenApiRequest $request object of OpenApiRequest - * @param RuntimeOptions $runtime which controls some details of call api, such as retry times - * - * @throws TeaError - * @throws Exception - * @throws TeaUnableRetryError - * - * @return array the response - */ - public function doROARequest($action, $version, $protocol, $method, $authType, $pathname, $bodyType, $request, $runtime) - { - $request->validate(); - $runtime->validate(); - $_runtime = [ - 'timeouted' => 'retry', - 'readTimeout' => Utils::defaultNumber($runtime->readTimeout, $this->_readTimeout), - 'connectTimeout' => Utils::defaultNumber($runtime->connectTimeout, $this->_connectTimeout), - 'httpProxy' => Utils::defaultString($runtime->httpProxy, $this->_httpProxy), - 'httpsProxy' => Utils::defaultString($runtime->httpsProxy, $this->_httpsProxy), - 'noProxy' => Utils::defaultString($runtime->noProxy, $this->_noProxy), - 'maxIdleConns' => Utils::defaultNumber($runtime->maxIdleConns, $this->_maxIdleConns), - 'retry' => [ - 'retryable' => $runtime->autoretry, - 'maxAttempts' => Utils::defaultNumber($runtime->maxAttempts, 3), - ], - 'backoff' => [ - 'policy' => Utils::defaultString($runtime->backoffPolicy, 'no'), - 'period' => Utils::defaultNumber($runtime->backoffPeriod, 1), - ], - 'ignoreSSL' => $runtime->ignoreSSL, - ]; - $_lastRequest = null; - $_lastException = null; - $_now = time(); - $_retryTimes = 0; - while (Tea::allowRetry(@$_runtime['retry'], $_retryTimes, $_now)) { - if ($_retryTimes > 0) { - $_backoffTime = Tea::getBackoffTime(@$_runtime['backoff'], $_retryTimes); - if ($_backoffTime > 0) { - Tea::sleep($_backoffTime); - } - } - $_retryTimes = $_retryTimes + 1; - - try { - $_request = new Request(); - $_request->protocol = Utils::defaultString($this->_protocol, $protocol); - $_request->method = $method; - $_request->pathname = $pathname; - $_request->headers = Tea::merge([ - 'date' => Utils::getDateUTCString(), - 'host' => $this->_endpoint, - 'accept' => 'application/json', - 'x-acs-signature-nonce' => Utils::getNonce(), - 'x-acs-signature-method' => 'HMAC-SHA1', - 'x-acs-signature-version' => '1.0', - 'x-acs-version' => $version, - 'x-acs-action' => $action, - 'user-agent' => Utils::getUserAgent($this->_userAgent), - ], $request->headers); - if (!Utils::isUnset($request->body)) { - $_request->body = Utils::toJSONString($request->body); - $_request->headers['content-type'] = 'application/json; charset=utf-8'; - } - if (!Utils::isUnset($request->query)) { - $_request->query = $request->query; - } - if (!Utils::equalString($authType, 'Anonymous')) { - $accessKeyId = $this->getAccessKeyId(); - $accessKeySecret = $this->getAccessKeySecret(); - $securityToken = $this->getSecurityToken(); - if (!Utils::empty_($securityToken)) { - $_request->headers['x-acs-accesskey-id'] = $accessKeyId; - $_request->headers['x-acs-security-token'] = $securityToken; - } - $stringToSign = OpenApiUtilClient::getStringToSign($_request); - $_request->headers['authorization'] = 'acs ' . $accessKeyId . ':' . OpenApiUtilClient::getROASignature($stringToSign, $accessKeySecret) . ''; - } - $_lastRequest = $_request; - $_response = Tea::send($_request, $_runtime); - if (Utils::equalNumber($_response->statusCode, 204)) { - return [ - 'headers' => $_response->headers, - ]; - } - if (Utils::is4xx($_response->statusCode) || Utils::is5xx($_response->statusCode)) { - $_res = Utils::readAsJSON($_response->body); - $err = Utils::assertAsMap($_res); - $requestId = self::defaultAny(@$err['RequestId'], @$err['requestId']); - $requestId = self::defaultAny($requestId, @$err['requestid']); - - throw new TeaError([ - 'code' => '' . (string) (self::defaultAny(@$err['Code'], @$err['code'])) . '', - 'message' => 'code: ' . (string) ($_response->statusCode) . ', ' . (string) (self::defaultAny(@$err['Message'], @$err['message'])) . ' request id: ' . (string) ($requestId) . '', - 'data' => $err, - ]); - } - if (Utils::equalString($bodyType, 'binary')) { - $resp = [ - 'body' => $_response->body, - 'headers' => $_response->headers, - ]; - - return $resp; - } - if (Utils::equalString($bodyType, 'byte')) { - $byt = Utils::readAsBytes($_response->body); - - return [ - 'body' => $byt, - 'headers' => $_response->headers, - ]; - } - if (Utils::equalString($bodyType, 'string')) { - $str = Utils::readAsString($_response->body); - - return [ - 'body' => $str, - 'headers' => $_response->headers, - ]; - } - if (Utils::equalString($bodyType, 'json')) { - $obj = Utils::readAsJSON($_response->body); - $res = Utils::assertAsMap($obj); - - return [ - 'body' => $res, - 'headers' => $_response->headers, - ]; - } - if (Utils::equalString($bodyType, 'array')) { - $arr = Utils::readAsJSON($_response->body); - - return [ - 'body' => $arr, - 'headers' => $_response->headers, - ]; - } - - return [ - 'headers' => $_response->headers, - ]; - } catch (Exception $e) { - if (!($e instanceof TeaError)) { - $e = new TeaError([], $e->getMessage(), $e->getCode(), $e); - } - if (Tea::isRetryable($e)) { - $_lastException = $e; - - continue; - } - - throw $e; - } - } - - throw new TeaUnableRetryError($_lastRequest, $_lastException); - } - - /** - * Encapsulate the request and invoke the network with form body. - * - * @param string $action api name - * @param string $version product version - * @param string $protocol http or https - * @param string $method e.g. GET - * @param string $authType authorization type e.g. AK - * @param string $pathname pathname of every api - * @param string $bodyType response body type e.g. String - * @param OpenApiRequest $request object of OpenApiRequest - * @param RuntimeOptions $runtime which controls some details of call api, such as retry times - * - * @throws TeaError - * @throws Exception - * @throws TeaUnableRetryError - * - * @return array the response - */ - public function doROARequestWithForm($action, $version, $protocol, $method, $authType, $pathname, $bodyType, $request, $runtime) - { - $request->validate(); - $runtime->validate(); - $_runtime = [ - 'timeouted' => 'retry', - 'readTimeout' => Utils::defaultNumber($runtime->readTimeout, $this->_readTimeout), - 'connectTimeout' => Utils::defaultNumber($runtime->connectTimeout, $this->_connectTimeout), - 'httpProxy' => Utils::defaultString($runtime->httpProxy, $this->_httpProxy), - 'httpsProxy' => Utils::defaultString($runtime->httpsProxy, $this->_httpsProxy), - 'noProxy' => Utils::defaultString($runtime->noProxy, $this->_noProxy), - 'maxIdleConns' => Utils::defaultNumber($runtime->maxIdleConns, $this->_maxIdleConns), - 'retry' => [ - 'retryable' => $runtime->autoretry, - 'maxAttempts' => Utils::defaultNumber($runtime->maxAttempts, 3), - ], - 'backoff' => [ - 'policy' => Utils::defaultString($runtime->backoffPolicy, 'no'), - 'period' => Utils::defaultNumber($runtime->backoffPeriod, 1), - ], - 'ignoreSSL' => $runtime->ignoreSSL, - ]; - $_lastRequest = null; - $_lastException = null; - $_now = time(); - $_retryTimes = 0; - while (Tea::allowRetry(@$_runtime['retry'], $_retryTimes, $_now)) { - if ($_retryTimes > 0) { - $_backoffTime = Tea::getBackoffTime(@$_runtime['backoff'], $_retryTimes); - if ($_backoffTime > 0) { - Tea::sleep($_backoffTime); - } - } - $_retryTimes = $_retryTimes + 1; - - try { - $_request = new Request(); - $_request->protocol = Utils::defaultString($this->_protocol, $protocol); - $_request->method = $method; - $_request->pathname = $pathname; - $_request->headers = Tea::merge([ - 'date' => Utils::getDateUTCString(), - 'host' => $this->_endpoint, - 'accept' => 'application/json', - 'x-acs-signature-nonce' => Utils::getNonce(), - 'x-acs-signature-method' => 'HMAC-SHA1', - 'x-acs-signature-version' => '1.0', - 'x-acs-version' => $version, - 'x-acs-action' => $action, - 'user-agent' => Utils::getUserAgent($this->_userAgent), - ], $request->headers); - if (!Utils::isUnset($request->body)) { - $m = Utils::assertAsMap($request->body); - $_request->body = OpenApiUtilClient::toForm($m); - $_request->headers['content-type'] = 'application/x-www-form-urlencoded'; - } - if (!Utils::isUnset($request->query)) { - $_request->query = $request->query; - } - if (!Utils::equalString($authType, 'Anonymous')) { - $accessKeyId = $this->getAccessKeyId(); - $accessKeySecret = $this->getAccessKeySecret(); - $securityToken = $this->getSecurityToken(); - if (!Utils::empty_($securityToken)) { - $_request->headers['x-acs-accesskey-id'] = $accessKeyId; - $_request->headers['x-acs-security-token'] = $securityToken; - } - $stringToSign = OpenApiUtilClient::getStringToSign($_request); - $_request->headers['authorization'] = 'acs ' . $accessKeyId . ':' . OpenApiUtilClient::getROASignature($stringToSign, $accessKeySecret) . ''; - } - $_lastRequest = $_request; - $_response = Tea::send($_request, $_runtime); - if (Utils::equalNumber($_response->statusCode, 204)) { - return [ - 'headers' => $_response->headers, - ]; - } - if (Utils::is4xx($_response->statusCode) || Utils::is5xx($_response->statusCode)) { - $_res = Utils::readAsJSON($_response->body); - $err = Utils::assertAsMap($_res); - - throw new TeaError([ - 'code' => '' . (string) (self::defaultAny(@$err['Code'], @$err['code'])) . '', - 'message' => 'code: ' . (string) ($_response->statusCode) . ', ' . (string) (self::defaultAny(@$err['Message'], @$err['message'])) . ' request id: ' . (string) (self::defaultAny(@$err['RequestId'], @$err['requestId'])) . '', - 'data' => $err, - ]); - } - if (Utils::equalString($bodyType, 'binary')) { - $resp = [ - 'body' => $_response->body, - 'headers' => $_response->headers, - ]; - - return $resp; - } - if (Utils::equalString($bodyType, 'byte')) { - $byt = Utils::readAsBytes($_response->body); - - return [ - 'body' => $byt, - 'headers' => $_response->headers, - ]; - } - if (Utils::equalString($bodyType, 'string')) { - $str = Utils::readAsString($_response->body); - - return [ - 'body' => $str, - 'headers' => $_response->headers, - ]; - } - if (Utils::equalString($bodyType, 'json')) { - $obj = Utils::readAsJSON($_response->body); - $res = Utils::assertAsMap($obj); - - return [ - 'body' => $res, - 'headers' => $_response->headers, - ]; - } - if (Utils::equalString($bodyType, 'array')) { - $arr = Utils::readAsJSON($_response->body); - - return [ - 'body' => $arr, - 'headers' => $_response->headers, - ]; - } - - return [ - 'headers' => $_response->headers, - ]; - } catch (Exception $e) { - if (!($e instanceof TeaError)) { - $e = new TeaError([], $e->getMessage(), $e->getCode(), $e); - } - if (Tea::isRetryable($e)) { - $_lastException = $e; - - continue; - } - - throw $e; - } - } - - throw new TeaUnableRetryError($_lastRequest, $_lastException); - } - - /** - * Encapsulate the request and invoke the network. - * - * @param Params $params - * @param OpenApiRequest $request object of OpenApiRequest - * @param RuntimeOptions $runtime which controls some details of call api, such as retry times - * - * @throws TeaError - * @throws Exception - * @throws TeaUnableRetryError - * - * @return array the response - */ - public function doRequest($params, $request, $runtime) - { - $params->validate(); - $request->validate(); - $runtime->validate(); - $_runtime = [ - 'timeouted' => 'retry', - 'readTimeout' => Utils::defaultNumber($runtime->readTimeout, $this->_readTimeout), - 'connectTimeout' => Utils::defaultNumber($runtime->connectTimeout, $this->_connectTimeout), - 'httpProxy' => Utils::defaultString($runtime->httpProxy, $this->_httpProxy), - 'httpsProxy' => Utils::defaultString($runtime->httpsProxy, $this->_httpsProxy), - 'noProxy' => Utils::defaultString($runtime->noProxy, $this->_noProxy), - 'maxIdleConns' => Utils::defaultNumber($runtime->maxIdleConns, $this->_maxIdleConns), - 'retry' => [ - 'retryable' => $runtime->autoretry, - 'maxAttempts' => Utils::defaultNumber($runtime->maxAttempts, 3), - ], - 'backoff' => [ - 'policy' => Utils::defaultString($runtime->backoffPolicy, 'no'), - 'period' => Utils::defaultNumber($runtime->backoffPeriod, 1), - ], - 'ignoreSSL' => $runtime->ignoreSSL, - ]; - $_lastRequest = null; - $_lastException = null; - $_now = time(); - $_retryTimes = 0; - while (Tea::allowRetry(@$_runtime['retry'], $_retryTimes, $_now)) { - if ($_retryTimes > 0) { - $_backoffTime = Tea::getBackoffTime(@$_runtime['backoff'], $_retryTimes); - if ($_backoffTime > 0) { - Tea::sleep($_backoffTime); - } - } - $_retryTimes = $_retryTimes + 1; - - try { - $_request = new Request(); - $_request->protocol = Utils::defaultString($this->_protocol, $params->protocol); - $_request->method = $params->method; - $_request->pathname = $params->pathname; - $_request->query = $request->query; - // endpoint is setted in product client - $_request->headers = Tea::merge([ - 'host' => $this->_endpoint, - 'x-acs-version' => $params->version, - 'x-acs-action' => $params->action, - 'user-agent' => $this->getUserAgent(), - 'x-acs-date' => OpenApiUtilClient::getTimestamp(), - 'x-acs-signature-nonce' => Utils::getNonce(), - 'accept' => 'application/json', - ], $request->headers); - $signatureAlgorithm = Utils::defaultString($this->_signatureAlgorithm, 'ACS3-HMAC-SHA256'); - $hashedRequestPayload = OpenApiUtilClient::hexEncode(OpenApiUtilClient::hash(Utils::toBytes(''), $signatureAlgorithm)); - if (!Utils::isUnset($request->stream)) { - $tmp = Utils::readAsBytes($request->stream); - $hashedRequestPayload = OpenApiUtilClient::hexEncode(OpenApiUtilClient::hash($tmp, $signatureAlgorithm)); - $_request->body = $tmp; - $_request->headers['content-type'] = 'application/octet-stream'; - } else { - if (!Utils::isUnset($request->body)) { - if (Utils::equalString($params->reqBodyType, 'json')) { - $jsonObj = Utils::toJSONString($request->body); - $hashedRequestPayload = OpenApiUtilClient::hexEncode(OpenApiUtilClient::hash(Utils::toBytes($jsonObj), $signatureAlgorithm)); - $_request->body = $jsonObj; - $_request->headers["content-type"] = "application/json; charset=utf-8"; - } else { - $m = Utils::assertAsMap($request->body); - $formObj = OpenApiUtilClient::toForm($m); - $hashedRequestPayload = OpenApiUtilClient::hexEncode(OpenApiUtilClient::hash(Utils::toBytes($formObj), $signatureAlgorithm)); - $_request->body = $formObj; - $_request->headers['content-type'] = 'application/x-www-form-urlencoded'; - } - } - } - $_request->headers['x-acs-content-sha256'] = $hashedRequestPayload; - if (!Utils::equalString($params->authType, 'Anonymous')) { - $accessKeyId = $this->getAccessKeyId(); - $accessKeySecret = $this->getAccessKeySecret(); - $securityToken = $this->getSecurityToken(); - if (!Utils::empty_($securityToken)) { - $_request->headers["x-acs-accesskey-id"] = $accessKeyId; - $_request->headers['x-acs-security-token'] = $securityToken; - } - $_request->headers['Authorization'] = OpenApiUtilClient::getAuthorization($_request, $signatureAlgorithm, $hashedRequestPayload, $accessKeyId, $accessKeySecret); - } - $_lastRequest = $_request; - $_response = Tea::send($_request, $_runtime); - if (Utils::is4xx($_response->statusCode) || Utils::is5xx($_response->statusCode)) { - $_res = Utils::readAsJSON($_response->body); - $err = Utils::assertAsMap($_res); - - throw new TeaError([ - 'code' => '' . (string) (self::defaultAny(@$err['Code'], @$err['code'])) . '', - 'message' => 'code: ' . (string) ($_response->statusCode) . ', ' . (string) (self::defaultAny(@$err['Message'], @$err['message'])) . ' request id: ' . (string) (self::defaultAny(@$err['RequestId'], @$err['requestId'])) . '', - 'data' => $err, - ]); - } - if (Utils::equalString($params->bodyType, 'binary')) { - $resp = [ - 'body' => $_response->body, - 'headers' => $_response->headers, - ]; - - return $resp; - } - if (Utils::equalString($params->bodyType, 'byte')) { - $byt = Utils::readAsBytes($_response->body); - - return [ - 'body' => $byt, - 'headers' => $_response->headers, - ]; - } - if (Utils::equalString($params->bodyType, 'string')) { - $str = Utils::readAsString($_response->body); - - return [ - 'body' => $str, - 'headers' => $_response->headers, - ]; - } - if (Utils::equalString($params->bodyType, 'json')) { - $obj = Utils::readAsJSON($_response->body); - $res = Utils::assertAsMap($obj); - - return [ - 'body' => $res, - 'headers' => $_response->headers, - ]; - } - if (Utils::equalString($params->bodyType, 'array')) { - $arr = Utils::readAsJSON($_response->body); - - return [ - 'body' => $arr, - 'headers' => $_response->headers, - ]; - } - - return [ - 'headers' => $_response->headers, - ]; - } catch (Exception $e) { - if (!($e instanceof TeaError)) { - $e = new TeaError([], $e->getMessage(), $e->getCode(), $e); - } - if (Tea::isRetryable($e)) { - $_lastException = $e; - - continue; - } - - throw $e; - } - } - - throw new TeaUnableRetryError($_lastRequest, $_lastException); - } - - /** - * @param Params $params - * @param OpenApiRequest $request - * @param RuntimeOptions $runtime - * - * @throws TeaError - * - * @return array - */ - public function callApi($params, $request, $runtime) - { - if (Utils::isUnset($params)) { - throw new TeaError([ - 'code' => 'ParameterMissing', - 'message' => "'params' can not be unset", - ]); - } - if (Utils::isUnset($this->_signatureAlgorithm) || !Utils::equalString($this->_signatureAlgorithm, 'v2')) { - return $this->doRequest($params, $request, $runtime); - } - if (Utils::equalString($params->style, 'ROA') && Utils::equalString($params->reqBodyType, 'json')) { - return $this->doROARequest($params->action, $params->version, $params->protocol, $params->method, $params->authType, $params->pathname, $params->bodyType, $request, $runtime); - } - if (Utils::equalString($params->style, 'ROA')) { - return $this->doROARequestWithForm($params->action, $params->version, $params->protocol, $params->method, $params->authType, $params->pathname, $params->bodyType, $request, $runtime); - } - - return $this->doRPCRequest($params->action, $params->version, $params->protocol, $params->method, $params->authType, $params->bodyType, $request, $runtime); - } - - /** - * Get user agent. - * - * @return string user agent - */ - public function getUserAgent() - { - return Utils::getUserAgent($this->_userAgent); - } - - /** - * Get accesskey id by using credential. - * - * @return string accesskey id - */ - public function getAccessKeyId() - { - if (Utils::isUnset($this->_credential)) { - return ''; - } - - return $this->_credential->getAccessKeyId(); - } - - /** - * Get accesskey secret by using credential. - * - * @return string accesskey secret - */ - public function getAccessKeySecret() - { - if (Utils::isUnset($this->_credential)) { - return ''; - } - - return $this->_credential->getAccessKeySecret(); - } - - /** - * Get security token by using credential. - * - * @return string security token - */ - public function getSecurityToken() - { - if (Utils::isUnset($this->_credential)) { - return ''; - } - - return $this->_credential->getSecurityToken(); - } - - /** - * If inputValue is not null, return it or return defaultValue. - * - * @param mixed $inputValue users input value - * @param mixed $defaultValue default value - * - * @return any the final result - */ - public static function defaultAny($inputValue, $defaultValue) - { - if (Utils::isUnset($inputValue)) { - return $defaultValue; - } - - return $inputValue; - } - - /** - * If the endpointRule and config.endpoint are empty, throw error. - * - * @param \Darabonba\OpenApi\Models\Config $config config contains the necessary information to create a client - * - * @throws TeaError - */ - public function checkConfig($config) - { - if (Utils::empty_($this->_endpointRule) && Utils::empty_($config->endpoint)) { - throw new TeaError([ - 'code' => 'ParameterMissing', - 'message' => "'config.endpoint' can not be empty", - ]); - } - } - - /** - * set RPC header for debug. - * - * @param string[] $headers headers for debug, this header can be used only once - */ - public function setRpcHeaders($headers) - { - $this->_headers = $headers; - } - - /** - * get RPC header for debug. - * - * @return array - */ - public function getRpcHeaders() - { - $headers = $this->_headers; - $this->_headers = null; - - return $headers; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/.gitignore b/vendor/alibabacloud/dysmsapi-20170525/.gitignore deleted file mode 100644 index 89c7aa5..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -composer.phar -/vendor/ - -# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control -# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -composer.lock - -.vscode/ -.idea -.DS_Store - -cache/ -*.cache -runtime/ -.php_cs.cache diff --git a/vendor/alibabacloud/dysmsapi-20170525/.php_cs.dist b/vendor/alibabacloud/dysmsapi-20170525/.php_cs.dist deleted file mode 100644 index 8617ec2..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/.php_cs.dist +++ /dev/null @@ -1,65 +0,0 @@ -setRiskyAllowed(true) - ->setIndent(' ') - ->setRules([ - '@PSR2' => true, - '@PhpCsFixer' => true, - '@Symfony:risky' => true, - 'concat_space' => ['spacing' => 'one'], - 'array_syntax' => ['syntax' => 'short'], - 'array_indentation' => true, - 'combine_consecutive_unsets' => true, - 'method_separation' => true, - 'single_quote' => true, - 'declare_equal_normalize' => true, - 'function_typehint_space' => true, - 'hash_to_slash_comment' => true, - 'include' => true, - 'lowercase_cast' => true, - 'no_multiline_whitespace_before_semicolons' => true, - 'no_leading_import_slash' => true, - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_spaces_around_offset' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unused_imports' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'object_operator_without_whitespace' => true, - 'single_blank_line_before_namespace' => true, - 'single_class_element_per_statement' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'whitespace_after_comma_in_array' => true, - 'no_extra_consecutive_blank_lines' => [ - 'curly_brace_block', - 'extra', - 'parenthesis_brace_block', - 'square_brace_block', - 'throw', - 'use', - ], - 'binary_operator_spaces' => [ - 'align_double_arrow' => true, - 'align_equals' => true, - ], - 'braces' => [ - 'allow_single_line_closure' => true, - ], - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude('vendor') - ->exclude('tests') - ->in(__DIR__) - ); diff --git a/vendor/alibabacloud/dysmsapi-20170525/ChangeLog.md b/vendor/alibabacloud/dysmsapi-20170525/ChangeLog.md deleted file mode 100644 index b7d5ffe..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/ChangeLog.md +++ /dev/null @@ -1,21 +0,0 @@ -2021-11-29 Version: 2.0.8 -- Upgrade Service for SMS. - -2021-11-16 Version: 2.0.7 -- Upgrade Service for SMS. - -2021-10-26 Version: 2.0.6 -- Support Short Url for SMS. - -2021-09-01 Version: 1.0.3 -- Generated php 2017-05-25 for Dysmsapi. - -2021-07-15 Version: 1.0.2 -- Generated php 2017-05-25 for Dysmsapi. - -2021-01-04 Version: 1.0.1 -- AMP Version Change. - -2020-12-29 Version: 1.0.0 -- AMP Version Change. - diff --git a/vendor/alibabacloud/dysmsapi-20170525/README-CN.md b/vendor/alibabacloud/dysmsapi-20170525/README-CN.md deleted file mode 100644 index 88f0eb6..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/README-CN.md +++ /dev/null @@ -1,35 +0,0 @@ -[English](README.md) | 简体中文 - -![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg) - -# Alibaba Cloud Dysmsapi SDK for PHP - -## 安装 - -### Composer - -```bash -composer require alibabacloud/dysmsapi-20170525 -``` - -## 问题 - -[提交 Issue](https://github.com/aliyun/alibabacloud-php-sdk/issues/new),不符合指南的问题可能会立即关闭。 - -## 使用说明 - -[快速使用](https://github.com/aliyun/alibabacloud-php-sdk/blob/master/docs/0-Examples-CN.md#%E5%BF%AB%E9%80%9F%E4%BD%BF%E7%94%A8) - -## 发行说明 - -每个版本的详细更改记录在[发行说明](./ChangeLog.txt)中。 - -## 相关 - -* [最新源码](https://github.com/aliyun/alibabacloud-php-sdk/) - -## 许可证 - -[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) - -Copyright (c) 2009-present, Alibaba Cloud All rights reserved. diff --git a/vendor/alibabacloud/dysmsapi-20170525/README.md b/vendor/alibabacloud/dysmsapi-20170525/README.md deleted file mode 100644 index b43be03..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/README.md +++ /dev/null @@ -1,35 +0,0 @@ -English | [简体中文](README-CN.md) - -![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg) - -# Alibaba Cloud Dysmsapi SDK for PHP - -## Installation - -### Composer - -```bash -composer require alibabacloud/dysmsapi-20170525 -``` - -## Issues - -[Opening an Issue](https://github.com/aliyun/alibabacloud-php-sdk/issues/new), Issues not conforming to the guidelines may be closed immediately. - -## Usage - -[Quick Examples](https://github.com/aliyun/alibabacloud-php-sdk/blob/master/docs/0-Examples-EN.md#quick-examples) - -## Changelog - -Detailed changes for each release are documented in the [release notes](./ChangeLog.txt). - -## References - -* [Latest Release](https://github.com/aliyun/alibabacloud-php-sdk/) - -## License - -[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) - -Copyright (c) 2009-present, Alibaba Cloud All rights reserved. diff --git a/vendor/alibabacloud/dysmsapi-20170525/autoload.php b/vendor/alibabacloud/dysmsapi-20170525/autoload.php deleted file mode 100644 index 9d19f07..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/autoload.php +++ /dev/null @@ -1,17 +0,0 @@ -5.5", - "alibabacloud/tea-utils": "^0.2.0", - "alibabacloud/darabonba-openapi": "^0.2.3", - "alibabacloud/openapi-util": "^0.1.9", - "alibabacloud/endpoint-util": "^0.1.0" - }, - "autoload": { - "psr-4": { - "AlibabaCloud\\SDK\\Dysmsapi\\V20170525\\": "src" - } - }, - "scripts": { - "fixer": "php-cs-fixer fix ./" - }, - "config": { - "sort-packages": true, - "preferred-install": "dist", - "optimize-autoloader": true - }, - "prefer-stable": true -} \ No newline at end of file diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Dysmsapi.php b/vendor/alibabacloud/dysmsapi-20170525/src/Dysmsapi.php deleted file mode 100644 index e82df40..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Dysmsapi.php +++ /dev/null @@ -1,1119 +0,0 @@ -_endpointRule = 'central'; - $this->_endpointMap = [ - 'ap-southeast-1' => 'dysmsapi.ap-southeast-1.aliyuncs.com', - 'ap-southeast-5' => 'dysmsapi-xman.ap-southeast-5.aliyuncs.com', - 'cn-beijing' => 'dysmsapi-proxy.cn-beijing.aliyuncs.com', - 'cn-hongkong' => 'dysmsapi-xman.cn-hongkong.aliyuncs.com', - ]; - $this->checkConfig($config); - $this->_endpoint = $this->getEndpoint('dysmsapi', $this->_regionId, $this->_endpointRule, $this->_network, $this->_suffix, $this->_endpointMap, $this->_endpoint); - } - - /** - * @param string $productId - * @param string $regionId - * @param string $endpointRule - * @param string $network - * @param string $suffix - * @param string[] $endpointMap - * @param string $endpoint - * - * @return string - */ - public function getEndpoint($productId, $regionId, $endpointRule, $network, $suffix, $endpointMap, $endpoint) - { - if (!Utils::empty_($endpoint)) { - return $endpoint; - } - if (!Utils::isUnset($endpointMap) && !Utils::empty_(@$endpointMap[$regionId])) { - return @$endpointMap[$regionId]; - } - - return Endpoint::getEndpointRules($productId, $regionId, $endpointRule, $network, $suffix); - } - - /** - * @param AddShortUrlRequest $request - * @param RuntimeOptions $runtime - * - * @return AddShortUrlResponse - */ - public function addShortUrlWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['OwnerId'] = $request->ownerId; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'AddShortUrl', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'formData', - 'bodyType' => 'json', - ]); - - return AddShortUrlResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param AddShortUrlRequest $request - * - * @return AddShortUrlResponse - */ - public function addShortUrl($request) - { - $runtime = new RuntimeOptions([]); - - return $this->addShortUrlWithOptions($request, $runtime); - } - - /** - * @param AddSmsSignRequest $request - * @param RuntimeOptions $runtime - * - * @return AddSmsSignResponse - */ - public function addSmsSignWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['OwnerId'] = $request->ownerId; - $query['Remark'] = $request->remark; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $query['SignName'] = $request->signName; - $query['SignSource'] = $request->signSource; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'AddSmsSign', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'formData', - 'bodyType' => 'json', - ]); - - return AddSmsSignResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param AddSmsSignRequest $request - * - * @return AddSmsSignResponse - */ - public function addSmsSign($request) - { - $runtime = new RuntimeOptions([]); - - return $this->addSmsSignWithOptions($request, $runtime); - } - - /** - * @param AddSmsTemplateRequest $request - * @param RuntimeOptions $runtime - * - * @return AddSmsTemplateResponse - */ - public function addSmsTemplateWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['OwnerId'] = $request->ownerId; - $query['Remark'] = $request->remark; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $query['TemplateContent'] = $request->templateContent; - $query['TemplateName'] = $request->templateName; - $query['TemplateType'] = $request->templateType; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'AddSmsTemplate', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return AddSmsTemplateResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param AddSmsTemplateRequest $request - * - * @return AddSmsTemplateResponse - */ - public function addSmsTemplate($request) - { - $runtime = new RuntimeOptions([]); - - return $this->addSmsTemplateWithOptions($request, $runtime); - } - - /** - * @param CreateCardSmsTemplateRequest $tmpReq - * @param RuntimeOptions $runtime - * - * @return CreateCardSmsTemplateResponse - */ - public function createCardSmsTemplateWithOptions($tmpReq, $runtime) - { - Utils::validateModel($tmpReq); - $request = new CreateCardSmsTemplateShrinkRequest([]); - OpenApiUtilClient::convert($tmpReq, $request); - if (!Utils::isUnset($tmpReq->template)) { - $request->templateShrink = OpenApiUtilClient::arrayToStringWithSpecifiedStyle($tmpReq->template, 'Template', 'json'); - } - $query = []; - $query['Memo'] = $request->memo; - $query['Template'] = $request->templateShrink; - $query['TemplateName'] = $request->templateName; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'CreateCardSmsTemplate', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return CreateCardSmsTemplateResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param CreateCardSmsTemplateRequest $request - * - * @return CreateCardSmsTemplateResponse - */ - public function createCardSmsTemplate($request) - { - $runtime = new RuntimeOptions([]); - - return $this->createCardSmsTemplateWithOptions($request, $runtime); - } - - /** - * @param DeleteShortUrlRequest $request - * @param RuntimeOptions $runtime - * - * @return DeleteShortUrlResponse - */ - public function deleteShortUrlWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['OwnerId'] = $request->ownerId; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'DeleteShortUrl', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'formData', - 'bodyType' => 'json', - ]); - - return DeleteShortUrlResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param DeleteShortUrlRequest $request - * - * @return DeleteShortUrlResponse - */ - public function deleteShortUrl($request) - { - $runtime = new RuntimeOptions([]); - - return $this->deleteShortUrlWithOptions($request, $runtime); - } - - /** - * @param DeleteSmsSignRequest $request - * @param RuntimeOptions $runtime - * - * @return DeleteSmsSignResponse - */ - public function deleteSmsSignWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['OwnerId'] = $request->ownerId; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $query['SignName'] = $request->signName; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'DeleteSmsSign', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return DeleteSmsSignResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param DeleteSmsSignRequest $request - * - * @return DeleteSmsSignResponse - */ - public function deleteSmsSign($request) - { - $runtime = new RuntimeOptions([]); - - return $this->deleteSmsSignWithOptions($request, $runtime); - } - - /** - * @param DeleteSmsTemplateRequest $request - * @param RuntimeOptions $runtime - * - * @return DeleteSmsTemplateResponse - */ - public function deleteSmsTemplateWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['OwnerId'] = $request->ownerId; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $query['TemplateCode'] = $request->templateCode; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'DeleteSmsTemplate', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return DeleteSmsTemplateResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param DeleteSmsTemplateRequest $request - * - * @return DeleteSmsTemplateResponse - */ - public function deleteSmsTemplate($request) - { - $runtime = new RuntimeOptions([]); - - return $this->deleteSmsTemplateWithOptions($request, $runtime); - } - - /** - * @param GetMediaResourceIdRequest $request - * @param RuntimeOptions $runtime - * - * @return GetMediaResourceIdResponse - */ - public function getMediaResourceIdWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['ExtendInfo'] = $request->extendInfo; - $query['FileSize'] = $request->fileSize; - $query['Memo'] = $request->memo; - $query['OssKey'] = $request->ossKey; - $query['ResourceType'] = $request->resourceType; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'GetMediaResourceId', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return GetMediaResourceIdResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param GetMediaResourceIdRequest $request - * - * @return GetMediaResourceIdResponse - */ - public function getMediaResourceId($request) - { - $runtime = new RuntimeOptions([]); - - return $this->getMediaResourceIdWithOptions($request, $runtime); - } - - /** - * @param RuntimeOptions $runtime - * - * @return GetOSSInfoForCardTemplateResponse - */ - public function getOSSInfoForCardTemplateWithOptions($runtime) - { - $req = new OpenApiRequest([]); - $params = new Params([ - 'action' => 'GetOSSInfoForCardTemplate', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return GetOSSInfoForCardTemplateResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @return GetOSSInfoForCardTemplateResponse - */ - public function getOSSInfoForCardTemplate() - { - $runtime = new RuntimeOptions([]); - - return $this->getOSSInfoForCardTemplateWithOptions($runtime); - } - - /** - * @param ListTagResourcesRequest $request - * @param RuntimeOptions $runtime - * - * @return ListTagResourcesResponse - */ - public function listTagResourcesWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['NextToken'] = $request->nextToken; - $query['OwnerId'] = $request->ownerId; - $query['PageSize'] = $request->pageSize; - $query['ProdCode'] = $request->prodCode; - $query['RegionId'] = $request->regionId; - $query['ResourceId'] = $request->resourceId; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $query['ResourceType'] = $request->resourceType; - $query['Tag'] = $request->tag; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'ListTagResources', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return ListTagResourcesResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param ListTagResourcesRequest $request - * - * @return ListTagResourcesResponse - */ - public function listTagResources($request) - { - $runtime = new RuntimeOptions([]); - - return $this->listTagResourcesWithOptions($request, $runtime); - } - - /** - * @param ModifySmsSignRequest $request - * @param RuntimeOptions $runtime - * - * @return ModifySmsSignResponse - */ - public function modifySmsSignWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['OwnerId'] = $request->ownerId; - $query['Remark'] = $request->remark; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $query['SignName'] = $request->signName; - $query['SignSource'] = $request->signSource; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'ModifySmsSign', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'formData', - 'bodyType' => 'json', - ]); - - return ModifySmsSignResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param ModifySmsSignRequest $request - * - * @return ModifySmsSignResponse - */ - public function modifySmsSign($request) - { - $runtime = new RuntimeOptions([]); - - return $this->modifySmsSignWithOptions($request, $runtime); - } - - /** - * @param ModifySmsTemplateRequest $request - * @param RuntimeOptions $runtime - * - * @return ModifySmsTemplateResponse - */ - public function modifySmsTemplateWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['OwnerId'] = $request->ownerId; - $query['Remark'] = $request->remark; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $query['TemplateCode'] = $request->templateCode; - $query['TemplateContent'] = $request->templateContent; - $query['TemplateName'] = $request->templateName; - $query['TemplateType'] = $request->templateType; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'ModifySmsTemplate', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return ModifySmsTemplateResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param ModifySmsTemplateRequest $request - * - * @return ModifySmsTemplateResponse - */ - public function modifySmsTemplate($request) - { - $runtime = new RuntimeOptions([]); - - return $this->modifySmsTemplateWithOptions($request, $runtime); - } - - /** - * @param QueryCardSmsTemplateRequest $request - * @param RuntimeOptions $runtime - * - * @return QueryCardSmsTemplateResponse - */ - public function queryCardSmsTemplateWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['TemplateCode'] = $request->templateCode; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'QueryCardSmsTemplate', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return QueryCardSmsTemplateResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param QueryCardSmsTemplateRequest $request - * - * @return QueryCardSmsTemplateResponse - */ - public function queryCardSmsTemplate($request) - { - $runtime = new RuntimeOptions([]); - - return $this->queryCardSmsTemplateWithOptions($request, $runtime); - } - - /** - * @param QuerySendDetailsRequest $request - * @param RuntimeOptions $runtime - * - * @return QuerySendDetailsResponse - */ - public function querySendDetailsWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['BizId'] = $request->bizId; - $query['CurrentPage'] = $request->currentPage; - $query['OwnerId'] = $request->ownerId; - $query['PageSize'] = $request->pageSize; - $query['PhoneNumber'] = $request->phoneNumber; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $query['SendDate'] = $request->sendDate; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'QuerySendDetails', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return QuerySendDetailsResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param QuerySendDetailsRequest $request - * - * @return QuerySendDetailsResponse - */ - public function querySendDetails($request) - { - $runtime = new RuntimeOptions([]); - - return $this->querySendDetailsWithOptions($request, $runtime); - } - - /** - * @param QueryShortUrlRequest $request - * @param RuntimeOptions $runtime - * - * @return QueryShortUrlResponse - */ - public function queryShortUrlWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['OwnerId'] = $request->ownerId; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'QueryShortUrl', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'formData', - 'bodyType' => 'json', - ]); - - return QueryShortUrlResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param QueryShortUrlRequest $request - * - * @return QueryShortUrlResponse - */ - public function queryShortUrl($request) - { - $runtime = new RuntimeOptions([]); - - return $this->queryShortUrlWithOptions($request, $runtime); - } - - /** - * @param QuerySmsSignRequest $request - * @param RuntimeOptions $runtime - * - * @return QuerySmsSignResponse - */ - public function querySmsSignWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['OwnerId'] = $request->ownerId; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $query['SignName'] = $request->signName; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'QuerySmsSign', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return QuerySmsSignResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param QuerySmsSignRequest $request - * - * @return QuerySmsSignResponse - */ - public function querySmsSign($request) - { - $runtime = new RuntimeOptions([]); - - return $this->querySmsSignWithOptions($request, $runtime); - } - - /** - * @param QuerySmsTemplateRequest $request - * @param RuntimeOptions $runtime - * - * @return QuerySmsTemplateResponse - */ - public function querySmsTemplateWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['OwnerId'] = $request->ownerId; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $query['TemplateCode'] = $request->templateCode; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'QuerySmsTemplate', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return QuerySmsTemplateResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param QuerySmsTemplateRequest $request - * - * @return QuerySmsTemplateResponse - */ - public function querySmsTemplate($request) - { - $runtime = new RuntimeOptions([]); - - return $this->querySmsTemplateWithOptions($request, $runtime); - } - - /** - * @param SendBatchSmsRequest $request - * @param RuntimeOptions $runtime - * - * @return SendBatchSmsResponse - */ - public function sendBatchSmsWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['OwnerId'] = $request->ownerId; - $query['PhoneNumberJson'] = $request->phoneNumberJson; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $query['SignNameJson'] = $request->signNameJson; - $query['SmsUpExtendCodeJson'] = $request->smsUpExtendCodeJson; - $query['TemplateCode'] = $request->templateCode; - $query['TemplateParamJson'] = $request->templateParamJson; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'SendBatchSms', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return SendBatchSmsResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param SendBatchSmsRequest $request - * - * @return SendBatchSmsResponse - */ - public function sendBatchSms($request) - { - $runtime = new RuntimeOptions([]); - - return $this->sendBatchSmsWithOptions($request, $runtime); - } - - /** - * @param SendCardSmsRequest $request - * @param RuntimeOptions $runtime - * - * @return SendCardSmsResponse - */ - public function sendCardSmsWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['CardObjects'] = $request->cardObjects; - $query['CardTemplateCode'] = $request->cardTemplateCode; - $query['DigitalTemplateCode'] = $request->digitalTemplateCode; - $query['DigitalTemplateParam'] = $request->digitalTemplateParam; - $query['FallbackType'] = $request->fallbackType; - $query['OutId'] = $request->outId; - $query['SignName'] = $request->signName; - $query['SmsTemplateCode'] = $request->smsTemplateCode; - $query['SmsTemplateParam'] = $request->smsTemplateParam; - $query['SmsUpExtendCode'] = $request->smsUpExtendCode; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'SendCardSms', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return SendCardSmsResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param SendCardSmsRequest $request - * - * @return SendCardSmsResponse - */ - public function sendCardSms($request) - { - $runtime = new RuntimeOptions([]); - - return $this->sendCardSmsWithOptions($request, $runtime); - } - - /** - * @param SendSmsRequest $request - * @param RuntimeOptions $runtime - * - * @return SendSmsResponse - */ - public function sendSmsWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['OutId'] = $request->outId; - $query['OwnerId'] = $request->ownerId; - $query['PhoneNumbers'] = $request->phoneNumbers; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $query['SignName'] = $request->signName; - $query['SmsUpExtendCode'] = $request->smsUpExtendCode; - $query['TemplateCode'] = $request->templateCode; - $query['TemplateParam'] = $request->templateParam; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'SendSms', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return SendSmsResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param SendSmsRequest $request - * - * @return SendSmsResponse - */ - public function sendSms($request) - { - $runtime = new RuntimeOptions([]); - - return $this->sendSmsWithOptions($request, $runtime); - } - - /** - * @param TagResourcesRequest $request - * @param RuntimeOptions $runtime - * - * @return TagResourcesResponse - */ - public function tagResourcesWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['OwnerId'] = $request->ownerId; - $query['ProdCode'] = $request->prodCode; - $query['RegionId'] = $request->regionId; - $query['ResourceId'] = $request->resourceId; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $query['ResourceType'] = $request->resourceType; - $query['Tag'] = $request->tag; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'TagResources', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return TagResourcesResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param TagResourcesRequest $request - * - * @return TagResourcesResponse - */ - public function tagResources($request) - { - $runtime = new RuntimeOptions([]); - - return $this->tagResourcesWithOptions($request, $runtime); - } - - /** - * @param UntagResourcesRequest $request - * @param RuntimeOptions $runtime - * - * @return UntagResourcesResponse - */ - public function untagResourcesWithOptions($request, $runtime) - { - Utils::validateModel($request); - $query = []; - $query['All'] = $request->all; - $query['OwnerId'] = $request->ownerId; - $query['ProdCode'] = $request->prodCode; - $query['RegionId'] = $request->regionId; - $query['ResourceId'] = $request->resourceId; - $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount; - $query['ResourceOwnerId'] = $request->resourceOwnerId; - $query['ResourceType'] = $request->resourceType; - $query['TagKey'] = $request->tagKey; - $req = new OpenApiRequest([ - 'query' => OpenApiUtilClient::query($query), - 'body' => Utils::toMap($request), - ]); - $params = new Params([ - 'action' => 'UntagResources', - 'version' => '2017-05-25', - 'protocol' => 'HTTPS', - 'pathname' => '/', - 'method' => 'POST', - 'authType' => 'AK', - 'style' => 'RPC', - 'reqBodyType' => 'json', - 'bodyType' => 'json', - ]); - - return UntagResourcesResponse::fromMap($this->callApi($params, $req, $runtime)); - } - - /** - * @param UntagResourcesRequest $request - * - * @return UntagResourcesResponse - */ - public function untagResources($request) - { - $runtime = new RuntimeOptions([]); - - return $this->untagResourcesWithOptions($request, $runtime); - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddShortUrlRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddShortUrlRequest.php deleted file mode 100644 index 5a6cdf2..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddShortUrlRequest.php +++ /dev/null @@ -1,107 +0,0 @@ - 'EffectiveDays', - 'ownerId' => 'OwnerId', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'shortUrlName' => 'ShortUrlName', - 'sourceUrl' => 'SourceUrl', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->effectiveDays) { - $res['EffectiveDays'] = $this->effectiveDays; - } - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->shortUrlName) { - $res['ShortUrlName'] = $this->shortUrlName; - } - if (null !== $this->sourceUrl) { - $res['SourceUrl'] = $this->sourceUrl; - } - - return $res; - } - - /** - * @param array $map - * - * @return AddShortUrlRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['EffectiveDays'])) { - $model->effectiveDays = $map['EffectiveDays']; - } - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['ShortUrlName'])) { - $model->shortUrlName = $map['ShortUrlName']; - } - if (isset($map['SourceUrl'])) { - $model->sourceUrl = $map['SourceUrl']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddShortUrlResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddShortUrlResponse.php deleted file mode 100644 index e3eb223..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddShortUrlResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return AddShortUrlResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = AddShortUrlResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddShortUrlResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddShortUrlResponseBody.php deleted file mode 100644 index 4a9eae8..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddShortUrlResponseBody.php +++ /dev/null @@ -1,84 +0,0 @@ - 'Code', - 'data' => 'Data', - 'message' => 'Message', - 'requestId' => 'RequestId', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->data) { - $res['Data'] = null !== $this->data ? $this->data->toMap() : null; - } - if (null !== $this->message) { - $res['Message'] = $this->message; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - - return $res; - } - - /** - * @param array $map - * - * @return AddShortUrlResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Data'])) { - $model->data = data::fromMap($map['Data']); - } - if (isset($map['Message'])) { - $model->message = $map['Message']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddShortUrlResponseBody/data.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddShortUrlResponseBody/data.php deleted file mode 100644 index 7a993da..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddShortUrlResponseBody/data.php +++ /dev/null @@ -1,71 +0,0 @@ - 'ExpireDate', - 'shortUrl' => 'ShortUrl', - 'sourceUrl' => 'SourceUrl', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->expireDate) { - $res['ExpireDate'] = $this->expireDate; - } - if (null !== $this->shortUrl) { - $res['ShortUrl'] = $this->shortUrl; - } - if (null !== $this->sourceUrl) { - $res['SourceUrl'] = $this->sourceUrl; - } - - return $res; - } - - /** - * @param array $map - * - * @return data - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['ExpireDate'])) { - $model->expireDate = $map['ExpireDate']; - } - if (isset($map['ShortUrl'])) { - $model->shortUrl = $map['ShortUrl']; - } - if (isset($map['SourceUrl'])) { - $model->sourceUrl = $map['SourceUrl']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsSignRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsSignRequest.php deleted file mode 100644 index a10754f..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsSignRequest.php +++ /dev/null @@ -1,132 +0,0 @@ - 'OwnerId', - 'remark' => 'Remark', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'signFileList' => 'SignFileList', - 'signName' => 'SignName', - 'signSource' => 'SignSource', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->remark) { - $res['Remark'] = $this->remark; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->signFileList) { - $res['SignFileList'] = []; - if (null !== $this->signFileList && \is_array($this->signFileList)) { - $n = 0; - foreach ($this->signFileList as $item) { - $res['SignFileList'][$n++] = null !== $item ? $item->toMap() : $item; - } - } - } - if (null !== $this->signName) { - $res['SignName'] = $this->signName; - } - if (null !== $this->signSource) { - $res['SignSource'] = $this->signSource; - } - - return $res; - } - - /** - * @param array $map - * - * @return AddSmsSignRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['Remark'])) { - $model->remark = $map['Remark']; - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['SignFileList'])) { - if (!empty($map['SignFileList'])) { - $model->signFileList = []; - $n = 0; - foreach ($map['SignFileList'] as $item) { - $model->signFileList[$n++] = null !== $item ? signFileList::fromMap($item) : $item; - } - } - } - if (isset($map['SignName'])) { - $model->signName = $map['SignName']; - } - if (isset($map['SignSource'])) { - $model->signSource = $map['SignSource']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsSignRequest/signFileList.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsSignRequest/signFileList.php deleted file mode 100644 index cb10bc6..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsSignRequest/signFileList.php +++ /dev/null @@ -1,59 +0,0 @@ - 'FileContents', - 'fileSuffix' => 'FileSuffix', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->fileContents) { - $res['FileContents'] = $this->fileContents; - } - if (null !== $this->fileSuffix) { - $res['FileSuffix'] = $this->fileSuffix; - } - - return $res; - } - - /** - * @param array $map - * - * @return signFileList - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['FileContents'])) { - $model->fileContents = $map['FileContents']; - } - if (isset($map['FileSuffix'])) { - $model->fileSuffix = $map['FileSuffix']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsSignResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsSignResponse.php deleted file mode 100644 index d5b89f3..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsSignResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return AddSmsSignResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = AddSmsSignResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsSignResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsSignResponseBody.php deleted file mode 100644 index 816ddc1..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsSignResponseBody.php +++ /dev/null @@ -1,83 +0,0 @@ - 'Code', - 'message' => 'Message', - 'requestId' => 'RequestId', - 'signName' => 'SignName', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->message) { - $res['Message'] = $this->message; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - if (null !== $this->signName) { - $res['SignName'] = $this->signName; - } - - return $res; - } - - /** - * @param array $map - * - * @return AddSmsSignResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Message'])) { - $model->message = $map['Message']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - if (isset($map['SignName'])) { - $model->signName = $map['SignName']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsTemplateRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsTemplateRequest.php deleted file mode 100644 index 5aa955c..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsTemplateRequest.php +++ /dev/null @@ -1,119 +0,0 @@ - 'OwnerId', - 'remark' => 'Remark', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'templateContent' => 'TemplateContent', - 'templateName' => 'TemplateName', - 'templateType' => 'TemplateType', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->remark) { - $res['Remark'] = $this->remark; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->templateContent) { - $res['TemplateContent'] = $this->templateContent; - } - if (null !== $this->templateName) { - $res['TemplateName'] = $this->templateName; - } - if (null !== $this->templateType) { - $res['TemplateType'] = $this->templateType; - } - - return $res; - } - - /** - * @param array $map - * - * @return AddSmsTemplateRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['Remark'])) { - $model->remark = $map['Remark']; - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['TemplateContent'])) { - $model->templateContent = $map['TemplateContent']; - } - if (isset($map['TemplateName'])) { - $model->templateName = $map['TemplateName']; - } - if (isset($map['TemplateType'])) { - $model->templateType = $map['TemplateType']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsTemplateResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsTemplateResponse.php deleted file mode 100644 index b07ad76..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsTemplateResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return AddSmsTemplateResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = AddSmsTemplateResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsTemplateResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsTemplateResponseBody.php deleted file mode 100644 index ad8e131..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/AddSmsTemplateResponseBody.php +++ /dev/null @@ -1,83 +0,0 @@ - 'Code', - 'message' => 'Message', - 'requestId' => 'RequestId', - 'templateCode' => 'TemplateCode', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->message) { - $res['Message'] = $this->message; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - if (null !== $this->templateCode) { - $res['TemplateCode'] = $this->templateCode; - } - - return $res; - } - - /** - * @param array $map - * - * @return AddSmsTemplateResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Message'])) { - $model->message = $map['Message']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - if (isset($map['TemplateCode'])) { - $model->templateCode = $map['TemplateCode']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateRequest.php deleted file mode 100644 index 7344957..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateRequest.php +++ /dev/null @@ -1,71 +0,0 @@ - 'Memo', - 'template' => 'Template', - 'templateName' => 'TemplateName', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->memo) { - $res['Memo'] = $this->memo; - } - if (null !== $this->template) { - $res['Template'] = $this->template; - } - if (null !== $this->templateName) { - $res['TemplateName'] = $this->templateName; - } - - return $res; - } - - /** - * @param array $map - * - * @return CreateCardSmsTemplateRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Memo'])) { - $model->memo = $map['Memo']; - } - if (isset($map['Template'])) { - $model->template = $map['Template']; - } - if (isset($map['TemplateName'])) { - $model->templateName = $map['TemplateName']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateResponse.php deleted file mode 100644 index 8112752..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return CreateCardSmsTemplateResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = CreateCardSmsTemplateResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateResponseBody.php deleted file mode 100644 index 8642c75..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateResponseBody.php +++ /dev/null @@ -1,84 +0,0 @@ - 'Code', - 'data' => 'Data', - 'requestId' => 'RequestId', - 'success' => 'Success', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->data) { - $res['Data'] = null !== $this->data ? $this->data->toMap() : null; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - if (null !== $this->success) { - $res['Success'] = $this->success; - } - - return $res; - } - - /** - * @param array $map - * - * @return CreateCardSmsTemplateResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Data'])) { - $model->data = data::fromMap($map['Data']); - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - if (isset($map['Success'])) { - $model->success = $map['Success']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateResponseBody/data.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateResponseBody/data.php deleted file mode 100644 index 2134716..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateResponseBody/data.php +++ /dev/null @@ -1,47 +0,0 @@ - 'TemplateCode', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->templateCode) { - $res['TemplateCode'] = $this->templateCode; - } - - return $res; - } - - /** - * @param array $map - * - * @return data - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['TemplateCode'])) { - $model->templateCode = $map['TemplateCode']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateShrinkRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateShrinkRequest.php deleted file mode 100644 index baddb44..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/CreateCardSmsTemplateShrinkRequest.php +++ /dev/null @@ -1,71 +0,0 @@ - 'Memo', - 'templateShrink' => 'Template', - 'templateName' => 'TemplateName', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->memo) { - $res['Memo'] = $this->memo; - } - if (null !== $this->templateShrink) { - $res['Template'] = $this->templateShrink; - } - if (null !== $this->templateName) { - $res['TemplateName'] = $this->templateName; - } - - return $res; - } - - /** - * @param array $map - * - * @return CreateCardSmsTemplateShrinkRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Memo'])) { - $model->memo = $map['Memo']; - } - if (isset($map['Template'])) { - $model->templateShrink = $map['Template']; - } - if (isset($map['TemplateName'])) { - $model->templateName = $map['TemplateName']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteShortUrlRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteShortUrlRequest.php deleted file mode 100644 index e177a51..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteShortUrlRequest.php +++ /dev/null @@ -1,83 +0,0 @@ - 'OwnerId', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'sourceUrl' => 'SourceUrl', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->sourceUrl) { - $res['SourceUrl'] = $this->sourceUrl; - } - - return $res; - } - - /** - * @param array $map - * - * @return DeleteShortUrlRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['SourceUrl'])) { - $model->sourceUrl = $map['SourceUrl']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteShortUrlResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteShortUrlResponse.php deleted file mode 100644 index 1c5e623..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteShortUrlResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return DeleteShortUrlResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = DeleteShortUrlResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteShortUrlResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteShortUrlResponseBody.php deleted file mode 100644 index adcc487..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteShortUrlResponseBody.php +++ /dev/null @@ -1,71 +0,0 @@ - 'Code', - 'message' => 'Message', - 'requestId' => 'RequestId', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->message) { - $res['Message'] = $this->message; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - - return $res; - } - - /** - * @param array $map - * - * @return DeleteShortUrlResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Message'])) { - $model->message = $map['Message']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsSignRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsSignRequest.php deleted file mode 100644 index 46070f2..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsSignRequest.php +++ /dev/null @@ -1,83 +0,0 @@ - 'OwnerId', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'signName' => 'SignName', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->signName) { - $res['SignName'] = $this->signName; - } - - return $res; - } - - /** - * @param array $map - * - * @return DeleteSmsSignRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['SignName'])) { - $model->signName = $map['SignName']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsSignResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsSignResponse.php deleted file mode 100644 index 896fe65..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsSignResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return DeleteSmsSignResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = DeleteSmsSignResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsSignResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsSignResponseBody.php deleted file mode 100644 index 42bb661..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsSignResponseBody.php +++ /dev/null @@ -1,83 +0,0 @@ - 'Code', - 'message' => 'Message', - 'requestId' => 'RequestId', - 'signName' => 'SignName', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->message) { - $res['Message'] = $this->message; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - if (null !== $this->signName) { - $res['SignName'] = $this->signName; - } - - return $res; - } - - /** - * @param array $map - * - * @return DeleteSmsSignResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Message'])) { - $model->message = $map['Message']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - if (isset($map['SignName'])) { - $model->signName = $map['SignName']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsTemplateRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsTemplateRequest.php deleted file mode 100644 index 79cb422..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsTemplateRequest.php +++ /dev/null @@ -1,83 +0,0 @@ - 'OwnerId', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'templateCode' => 'TemplateCode', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->templateCode) { - $res['TemplateCode'] = $this->templateCode; - } - - return $res; - } - - /** - * @param array $map - * - * @return DeleteSmsTemplateRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['TemplateCode'])) { - $model->templateCode = $map['TemplateCode']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsTemplateResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsTemplateResponse.php deleted file mode 100644 index 58a14b5..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsTemplateResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return DeleteSmsTemplateResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = DeleteSmsTemplateResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsTemplateResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsTemplateResponseBody.php deleted file mode 100644 index 532244d..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/DeleteSmsTemplateResponseBody.php +++ /dev/null @@ -1,83 +0,0 @@ - 'Code', - 'message' => 'Message', - 'requestId' => 'RequestId', - 'templateCode' => 'TemplateCode', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->message) { - $res['Message'] = $this->message; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - if (null !== $this->templateCode) { - $res['TemplateCode'] = $this->templateCode; - } - - return $res; - } - - /** - * @param array $map - * - * @return DeleteSmsTemplateResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Message'])) { - $model->message = $map['Message']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - if (isset($map['TemplateCode'])) { - $model->templateCode = $map['TemplateCode']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetMediaResourceIdRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetMediaResourceIdRequest.php deleted file mode 100644 index b036976..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetMediaResourceIdRequest.php +++ /dev/null @@ -1,95 +0,0 @@ - 'ExtendInfo', - 'fileSize' => 'FileSize', - 'memo' => 'Memo', - 'ossKey' => 'OssKey', - 'resourceType' => 'ResourceType', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->extendInfo) { - $res['ExtendInfo'] = $this->extendInfo; - } - if (null !== $this->fileSize) { - $res['FileSize'] = $this->fileSize; - } - if (null !== $this->memo) { - $res['Memo'] = $this->memo; - } - if (null !== $this->ossKey) { - $res['OssKey'] = $this->ossKey; - } - if (null !== $this->resourceType) { - $res['ResourceType'] = $this->resourceType; - } - - return $res; - } - - /** - * @param array $map - * - * @return GetMediaResourceIdRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['ExtendInfo'])) { - $model->extendInfo = $map['ExtendInfo']; - } - if (isset($map['FileSize'])) { - $model->fileSize = $map['FileSize']; - } - if (isset($map['Memo'])) { - $model->memo = $map['Memo']; - } - if (isset($map['OssKey'])) { - $model->ossKey = $map['OssKey']; - } - if (isset($map['ResourceType'])) { - $model->resourceType = $map['ResourceType']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetMediaResourceIdResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetMediaResourceIdResponse.php deleted file mode 100644 index 11662ff..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetMediaResourceIdResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return GetMediaResourceIdResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = GetMediaResourceIdResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetMediaResourceIdResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetMediaResourceIdResponseBody.php deleted file mode 100644 index a0b9b5c..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetMediaResourceIdResponseBody.php +++ /dev/null @@ -1,84 +0,0 @@ - 'Code', - 'data' => 'Data', - 'requestId' => 'RequestId', - 'success' => 'Success', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->data) { - $res['Data'] = null !== $this->data ? $this->data->toMap() : null; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - if (null !== $this->success) { - $res['Success'] = $this->success; - } - - return $res; - } - - /** - * @param array $map - * - * @return GetMediaResourceIdResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Data'])) { - $model->data = data::fromMap($map['Data']); - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - if (isset($map['Success'])) { - $model->success = $map['Success']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetMediaResourceIdResponseBody/data.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetMediaResourceIdResponseBody/data.php deleted file mode 100644 index 13eebd0..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetMediaResourceIdResponseBody/data.php +++ /dev/null @@ -1,47 +0,0 @@ - 'ResourceId', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->resourceId) { - $res['ResourceId'] = $this->resourceId; - } - - return $res; - } - - /** - * @param array $map - * - * @return data - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['ResourceId'])) { - $model->resourceId = $map['ResourceId']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetOSSInfoForCardTemplateResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetOSSInfoForCardTemplateResponse.php deleted file mode 100644 index 9901132..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetOSSInfoForCardTemplateResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return GetOSSInfoForCardTemplateResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = GetOSSInfoForCardTemplateResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetOSSInfoForCardTemplateResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetOSSInfoForCardTemplateResponseBody.php deleted file mode 100644 index c37b527..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetOSSInfoForCardTemplateResponseBody.php +++ /dev/null @@ -1,84 +0,0 @@ - 'Code', - 'data' => 'Data', - 'requestId' => 'RequestId', - 'success' => 'Success', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->data) { - $res['Data'] = null !== $this->data ? $this->data->toMap() : null; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - if (null !== $this->success) { - $res['Success'] = $this->success; - } - - return $res; - } - - /** - * @param array $map - * - * @return GetOSSInfoForCardTemplateResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Data'])) { - $model->data = data::fromMap($map['Data']); - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - if (isset($map['Success'])) { - $model->success = $map['Success']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetOSSInfoForCardTemplateResponseBody/data.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetOSSInfoForCardTemplateResponseBody/data.php deleted file mode 100644 index 6529d02..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/GetOSSInfoForCardTemplateResponseBody/data.php +++ /dev/null @@ -1,107 +0,0 @@ - 'AccessKeyId', - 'aliUid' => 'AliUid', - 'expireTime' => 'ExpireTime', - 'host' => 'Host', - 'policy' => 'Policy', - 'signature' => 'Signature', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->accessKeyId) { - $res['AccessKeyId'] = $this->accessKeyId; - } - if (null !== $this->aliUid) { - $res['AliUid'] = $this->aliUid; - } - if (null !== $this->expireTime) { - $res['ExpireTime'] = $this->expireTime; - } - if (null !== $this->host) { - $res['Host'] = $this->host; - } - if (null !== $this->policy) { - $res['Policy'] = $this->policy; - } - if (null !== $this->signature) { - $res['Signature'] = $this->signature; - } - - return $res; - } - - /** - * @param array $map - * - * @return data - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['AccessKeyId'])) { - $model->accessKeyId = $map['AccessKeyId']; - } - if (isset($map['AliUid'])) { - $model->aliUid = $map['AliUid']; - } - if (isset($map['ExpireTime'])) { - $model->expireTime = $map['ExpireTime']; - } - if (isset($map['Host'])) { - $model->host = $map['Host']; - } - if (isset($map['Policy'])) { - $model->policy = $map['Policy']; - } - if (isset($map['Signature'])) { - $model->signature = $map['Signature']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesRequest.php deleted file mode 100644 index 331c496..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesRequest.php +++ /dev/null @@ -1,170 +0,0 @@ - 'NextToken', - 'ownerId' => 'OwnerId', - 'pageSize' => 'PageSize', - 'prodCode' => 'ProdCode', - 'regionId' => 'RegionId', - 'resourceId' => 'ResourceId', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'resourceType' => 'ResourceType', - 'tag' => 'Tag', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->nextToken) { - $res['NextToken'] = $this->nextToken; - } - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->pageSize) { - $res['PageSize'] = $this->pageSize; - } - if (null !== $this->prodCode) { - $res['ProdCode'] = $this->prodCode; - } - if (null !== $this->regionId) { - $res['RegionId'] = $this->regionId; - } - if (null !== $this->resourceId) { - $res['ResourceId'] = $this->resourceId; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->resourceType) { - $res['ResourceType'] = $this->resourceType; - } - if (null !== $this->tag) { - $res['Tag'] = []; - if (null !== $this->tag && \is_array($this->tag)) { - $n = 0; - foreach ($this->tag as $item) { - $res['Tag'][$n++] = null !== $item ? $item->toMap() : $item; - } - } - } - - return $res; - } - - /** - * @param array $map - * - * @return ListTagResourcesRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['NextToken'])) { - $model->nextToken = $map['NextToken']; - } - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['PageSize'])) { - $model->pageSize = $map['PageSize']; - } - if (isset($map['ProdCode'])) { - $model->prodCode = $map['ProdCode']; - } - if (isset($map['RegionId'])) { - $model->regionId = $map['RegionId']; - } - if (isset($map['ResourceId'])) { - if (!empty($map['ResourceId'])) { - $model->resourceId = $map['ResourceId']; - } - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['ResourceType'])) { - $model->resourceType = $map['ResourceType']; - } - if (isset($map['Tag'])) { - if (!empty($map['Tag'])) { - $model->tag = []; - $n = 0; - foreach ($map['Tag'] as $item) { - $model->tag[$n++] = null !== $item ? tag::fromMap($item) : $item; - } - } - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesRequest/tag.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesRequest/tag.php deleted file mode 100644 index dc71f32..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesRequest/tag.php +++ /dev/null @@ -1,59 +0,0 @@ - 'Key', - 'value' => 'Value', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->key) { - $res['Key'] = $this->key; - } - if (null !== $this->value) { - $res['Value'] = $this->value; - } - - return $res; - } - - /** - * @param array $map - * - * @return tag - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Key'])) { - $model->key = $map['Key']; - } - if (isset($map['Value'])) { - $model->value = $map['Value']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesResponse.php deleted file mode 100644 index d1332a2..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return ListTagResourcesResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = ListTagResourcesResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesResponseBody.php deleted file mode 100644 index 3312422..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesResponseBody.php +++ /dev/null @@ -1,84 +0,0 @@ - 'Code', - 'nextToken' => 'NextToken', - 'requestId' => 'RequestId', - 'tagResources' => 'TagResources', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->nextToken) { - $res['NextToken'] = $this->nextToken; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - if (null !== $this->tagResources) { - $res['TagResources'] = null !== $this->tagResources ? $this->tagResources->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return ListTagResourcesResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['NextToken'])) { - $model->nextToken = $map['NextToken']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - if (isset($map['TagResources'])) { - $model->tagResources = tagResources::fromMap($map['TagResources']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesResponseBody/tagResources.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesResponseBody/tagResources.php deleted file mode 100644 index b360bea..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesResponseBody/tagResources.php +++ /dev/null @@ -1,60 +0,0 @@ - 'TagResource', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->tagResource) { - $res['TagResource'] = []; - if (null !== $this->tagResource && \is_array($this->tagResource)) { - $n = 0; - foreach ($this->tagResource as $item) { - $res['TagResource'][$n++] = null !== $item ? $item->toMap() : $item; - } - } - } - - return $res; - } - - /** - * @param array $map - * - * @return tagResources - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['TagResource'])) { - if (!empty($map['TagResource'])) { - $model->tagResource = []; - $n = 0; - foreach ($map['TagResource'] as $item) { - $model->tagResource[$n++] = null !== $item ? tagResource::fromMap($item) : $item; - } - } - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesResponseBody/tagResources/tagResource.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesResponseBody/tagResources/tagResource.php deleted file mode 100644 index 53ed0ad..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ListTagResourcesResponseBody/tagResources/tagResource.php +++ /dev/null @@ -1,83 +0,0 @@ - 'ResourceId', - 'resourceType' => 'ResourceType', - 'tagKey' => 'TagKey', - 'tagValue' => 'TagValue', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->resourceId) { - $res['ResourceId'] = $this->resourceId; - } - if (null !== $this->resourceType) { - $res['ResourceType'] = $this->resourceType; - } - if (null !== $this->tagKey) { - $res['TagKey'] = $this->tagKey; - } - if (null !== $this->tagValue) { - $res['TagValue'] = $this->tagValue; - } - - return $res; - } - - /** - * @param array $map - * - * @return tagResource - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['ResourceId'])) { - $model->resourceId = $map['ResourceId']; - } - if (isset($map['ResourceType'])) { - $model->resourceType = $map['ResourceType']; - } - if (isset($map['TagKey'])) { - $model->tagKey = $map['TagKey']; - } - if (isset($map['TagValue'])) { - $model->tagValue = $map['TagValue']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsSignRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsSignRequest.php deleted file mode 100644 index 3593039..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsSignRequest.php +++ /dev/null @@ -1,132 +0,0 @@ - 'OwnerId', - 'remark' => 'Remark', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'signFileList' => 'SignFileList', - 'signName' => 'SignName', - 'signSource' => 'SignSource', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->remark) { - $res['Remark'] = $this->remark; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->signFileList) { - $res['SignFileList'] = []; - if (null !== $this->signFileList && \is_array($this->signFileList)) { - $n = 0; - foreach ($this->signFileList as $item) { - $res['SignFileList'][$n++] = null !== $item ? $item->toMap() : $item; - } - } - } - if (null !== $this->signName) { - $res['SignName'] = $this->signName; - } - if (null !== $this->signSource) { - $res['SignSource'] = $this->signSource; - } - - return $res; - } - - /** - * @param array $map - * - * @return ModifySmsSignRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['Remark'])) { - $model->remark = $map['Remark']; - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['SignFileList'])) { - if (!empty($map['SignFileList'])) { - $model->signFileList = []; - $n = 0; - foreach ($map['SignFileList'] as $item) { - $model->signFileList[$n++] = null !== $item ? signFileList::fromMap($item) : $item; - } - } - } - if (isset($map['SignName'])) { - $model->signName = $map['SignName']; - } - if (isset($map['SignSource'])) { - $model->signSource = $map['SignSource']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsSignRequest/signFileList.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsSignRequest/signFileList.php deleted file mode 100644 index f0dc661..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsSignRequest/signFileList.php +++ /dev/null @@ -1,59 +0,0 @@ - 'FileContents', - 'fileSuffix' => 'FileSuffix', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->fileContents) { - $res['FileContents'] = $this->fileContents; - } - if (null !== $this->fileSuffix) { - $res['FileSuffix'] = $this->fileSuffix; - } - - return $res; - } - - /** - * @param array $map - * - * @return signFileList - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['FileContents'])) { - $model->fileContents = $map['FileContents']; - } - if (isset($map['FileSuffix'])) { - $model->fileSuffix = $map['FileSuffix']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsSignResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsSignResponse.php deleted file mode 100644 index 9313751..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsSignResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return ModifySmsSignResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = ModifySmsSignResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsSignResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsSignResponseBody.php deleted file mode 100644 index a6bfe93..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsSignResponseBody.php +++ /dev/null @@ -1,83 +0,0 @@ - 'Code', - 'message' => 'Message', - 'requestId' => 'RequestId', - 'signName' => 'SignName', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->message) { - $res['Message'] = $this->message; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - if (null !== $this->signName) { - $res['SignName'] = $this->signName; - } - - return $res; - } - - /** - * @param array $map - * - * @return ModifySmsSignResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Message'])) { - $model->message = $map['Message']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - if (isset($map['SignName'])) { - $model->signName = $map['SignName']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsTemplateRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsTemplateRequest.php deleted file mode 100644 index d8e438c..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsTemplateRequest.php +++ /dev/null @@ -1,131 +0,0 @@ - 'OwnerId', - 'remark' => 'Remark', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'templateCode' => 'TemplateCode', - 'templateContent' => 'TemplateContent', - 'templateName' => 'TemplateName', - 'templateType' => 'TemplateType', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->remark) { - $res['Remark'] = $this->remark; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->templateCode) { - $res['TemplateCode'] = $this->templateCode; - } - if (null !== $this->templateContent) { - $res['TemplateContent'] = $this->templateContent; - } - if (null !== $this->templateName) { - $res['TemplateName'] = $this->templateName; - } - if (null !== $this->templateType) { - $res['TemplateType'] = $this->templateType; - } - - return $res; - } - - /** - * @param array $map - * - * @return ModifySmsTemplateRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['Remark'])) { - $model->remark = $map['Remark']; - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['TemplateCode'])) { - $model->templateCode = $map['TemplateCode']; - } - if (isset($map['TemplateContent'])) { - $model->templateContent = $map['TemplateContent']; - } - if (isset($map['TemplateName'])) { - $model->templateName = $map['TemplateName']; - } - if (isset($map['TemplateType'])) { - $model->templateType = $map['TemplateType']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsTemplateResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsTemplateResponse.php deleted file mode 100644 index 2f4d7a3..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsTemplateResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return ModifySmsTemplateResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = ModifySmsTemplateResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsTemplateResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsTemplateResponseBody.php deleted file mode 100644 index 7403f14..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/ModifySmsTemplateResponseBody.php +++ /dev/null @@ -1,83 +0,0 @@ - 'Code', - 'message' => 'Message', - 'requestId' => 'RequestId', - 'templateCode' => 'TemplateCode', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->message) { - $res['Message'] = $this->message; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - if (null !== $this->templateCode) { - $res['TemplateCode'] = $this->templateCode; - } - - return $res; - } - - /** - * @param array $map - * - * @return ModifySmsTemplateResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Message'])) { - $model->message = $map['Message']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - if (isset($map['TemplateCode'])) { - $model->templateCode = $map['TemplateCode']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryCardSmsTemplateRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryCardSmsTemplateRequest.php deleted file mode 100644 index 26747a8..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryCardSmsTemplateRequest.php +++ /dev/null @@ -1,47 +0,0 @@ - 'TemplateCode', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->templateCode) { - $res['TemplateCode'] = $this->templateCode; - } - - return $res; - } - - /** - * @param array $map - * - * @return QueryCardSmsTemplateRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['TemplateCode'])) { - $model->templateCode = $map['TemplateCode']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryCardSmsTemplateResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryCardSmsTemplateResponse.php deleted file mode 100644 index 955fb75..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryCardSmsTemplateResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return QueryCardSmsTemplateResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = QueryCardSmsTemplateResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryCardSmsTemplateResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryCardSmsTemplateResponseBody.php deleted file mode 100644 index 6911c41..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryCardSmsTemplateResponseBody.php +++ /dev/null @@ -1,84 +0,0 @@ - 'Code', - 'data' => 'Data', - 'requestId' => 'RequestId', - 'success' => 'Success', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->data) { - $res['Data'] = null !== $this->data ? $this->data->toMap() : null; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - if (null !== $this->success) { - $res['Success'] = $this->success; - } - - return $res; - } - - /** - * @param array $map - * - * @return QueryCardSmsTemplateResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Data'])) { - $model->data = data::fromMap($map['Data']); - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - if (isset($map['Success'])) { - $model->success = $map['Success']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryCardSmsTemplateResponseBody/data.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryCardSmsTemplateResponseBody/data.php deleted file mode 100644 index 1c7e6a7..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryCardSmsTemplateResponseBody/data.php +++ /dev/null @@ -1,49 +0,0 @@ - 'Templates', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->templates) { - $res['Templates'] = $this->templates; - } - - return $res; - } - - /** - * @param array $map - * - * @return data - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Templates'])) { - if (!empty($map['Templates'])) { - $model->templates = $map['Templates']; - } - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsRequest.php deleted file mode 100644 index 7ba305c..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsRequest.php +++ /dev/null @@ -1,131 +0,0 @@ - 'BizId', - 'currentPage' => 'CurrentPage', - 'ownerId' => 'OwnerId', - 'pageSize' => 'PageSize', - 'phoneNumber' => 'PhoneNumber', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'sendDate' => 'SendDate', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->bizId) { - $res['BizId'] = $this->bizId; - } - if (null !== $this->currentPage) { - $res['CurrentPage'] = $this->currentPage; - } - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->pageSize) { - $res['PageSize'] = $this->pageSize; - } - if (null !== $this->phoneNumber) { - $res['PhoneNumber'] = $this->phoneNumber; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->sendDate) { - $res['SendDate'] = $this->sendDate; - } - - return $res; - } - - /** - * @param array $map - * - * @return QuerySendDetailsRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['BizId'])) { - $model->bizId = $map['BizId']; - } - if (isset($map['CurrentPage'])) { - $model->currentPage = $map['CurrentPage']; - } - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['PageSize'])) { - $model->pageSize = $map['PageSize']; - } - if (isset($map['PhoneNumber'])) { - $model->phoneNumber = $map['PhoneNumber']; - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['SendDate'])) { - $model->sendDate = $map['SendDate']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsResponse.php deleted file mode 100644 index 1c80917..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return QuerySendDetailsResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = QuerySendDetailsResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsResponseBody.php deleted file mode 100644 index 6618e46..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsResponseBody.php +++ /dev/null @@ -1,96 +0,0 @@ - 'Code', - 'message' => 'Message', - 'requestId' => 'RequestId', - 'smsSendDetailDTOs' => 'SmsSendDetailDTOs', - 'totalCount' => 'TotalCount', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->message) { - $res['Message'] = $this->message; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - if (null !== $this->smsSendDetailDTOs) { - $res['SmsSendDetailDTOs'] = null !== $this->smsSendDetailDTOs ? $this->smsSendDetailDTOs->toMap() : null; - } - if (null !== $this->totalCount) { - $res['TotalCount'] = $this->totalCount; - } - - return $res; - } - - /** - * @param array $map - * - * @return QuerySendDetailsResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Message'])) { - $model->message = $map['Message']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - if (isset($map['SmsSendDetailDTOs'])) { - $model->smsSendDetailDTOs = smsSendDetailDTOs::fromMap($map['SmsSendDetailDTOs']); - } - if (isset($map['TotalCount'])) { - $model->totalCount = $map['TotalCount']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsResponseBody/smsSendDetailDTOs.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsResponseBody/smsSendDetailDTOs.php deleted file mode 100644 index 3b0564d..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsResponseBody/smsSendDetailDTOs.php +++ /dev/null @@ -1,60 +0,0 @@ - 'SmsSendDetailDTO', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->smsSendDetailDTO) { - $res['SmsSendDetailDTO'] = []; - if (null !== $this->smsSendDetailDTO && \is_array($this->smsSendDetailDTO)) { - $n = 0; - foreach ($this->smsSendDetailDTO as $item) { - $res['SmsSendDetailDTO'][$n++] = null !== $item ? $item->toMap() : $item; - } - } - } - - return $res; - } - - /** - * @param array $map - * - * @return smsSendDetailDTOs - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['SmsSendDetailDTO'])) { - if (!empty($map['SmsSendDetailDTO'])) { - $model->smsSendDetailDTO = []; - $n = 0; - foreach ($map['SmsSendDetailDTO'] as $item) { - $model->smsSendDetailDTO[$n++] = null !== $item ? smsSendDetailDTO::fromMap($item) : $item; - } - } - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsResponseBody/smsSendDetailDTOs/smsSendDetailDTO.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsResponseBody/smsSendDetailDTOs/smsSendDetailDTO.php deleted file mode 100644 index b3ee5c3..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySendDetailsResponseBody/smsSendDetailDTOs/smsSendDetailDTO.php +++ /dev/null @@ -1,131 +0,0 @@ - 'Content', - 'errCode' => 'ErrCode', - 'outId' => 'OutId', - 'phoneNum' => 'PhoneNum', - 'receiveDate' => 'ReceiveDate', - 'sendDate' => 'SendDate', - 'sendStatus' => 'SendStatus', - 'templateCode' => 'TemplateCode', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->content) { - $res['Content'] = $this->content; - } - if (null !== $this->errCode) { - $res['ErrCode'] = $this->errCode; - } - if (null !== $this->outId) { - $res['OutId'] = $this->outId; - } - if (null !== $this->phoneNum) { - $res['PhoneNum'] = $this->phoneNum; - } - if (null !== $this->receiveDate) { - $res['ReceiveDate'] = $this->receiveDate; - } - if (null !== $this->sendDate) { - $res['SendDate'] = $this->sendDate; - } - if (null !== $this->sendStatus) { - $res['SendStatus'] = $this->sendStatus; - } - if (null !== $this->templateCode) { - $res['TemplateCode'] = $this->templateCode; - } - - return $res; - } - - /** - * @param array $map - * - * @return smsSendDetailDTO - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Content'])) { - $model->content = $map['Content']; - } - if (isset($map['ErrCode'])) { - $model->errCode = $map['ErrCode']; - } - if (isset($map['OutId'])) { - $model->outId = $map['OutId']; - } - if (isset($map['PhoneNum'])) { - $model->phoneNum = $map['PhoneNum']; - } - if (isset($map['ReceiveDate'])) { - $model->receiveDate = $map['ReceiveDate']; - } - if (isset($map['SendDate'])) { - $model->sendDate = $map['SendDate']; - } - if (isset($map['SendStatus'])) { - $model->sendStatus = $map['SendStatus']; - } - if (isset($map['TemplateCode'])) { - $model->templateCode = $map['TemplateCode']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryShortUrlRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryShortUrlRequest.php deleted file mode 100644 index e63e2a1..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryShortUrlRequest.php +++ /dev/null @@ -1,83 +0,0 @@ - 'OwnerId', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'shortUrl' => 'ShortUrl', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->shortUrl) { - $res['ShortUrl'] = $this->shortUrl; - } - - return $res; - } - - /** - * @param array $map - * - * @return QueryShortUrlRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['ShortUrl'])) { - $model->shortUrl = $map['ShortUrl']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryShortUrlResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryShortUrlResponse.php deleted file mode 100644 index 7cd83b9..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryShortUrlResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return QueryShortUrlResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = QueryShortUrlResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryShortUrlResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryShortUrlResponseBody.php deleted file mode 100644 index b5f471c..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryShortUrlResponseBody.php +++ /dev/null @@ -1,84 +0,0 @@ - 'Code', - 'data' => 'Data', - 'message' => 'Message', - 'requestId' => 'RequestId', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->data) { - $res['Data'] = null !== $this->data ? $this->data->toMap() : null; - } - if (null !== $this->message) { - $res['Message'] = $this->message; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - - return $res; - } - - /** - * @param array $map - * - * @return QueryShortUrlResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Data'])) { - $model->data = data::fromMap($map['Data']); - } - if (isset($map['Message'])) { - $model->message = $map['Message']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryShortUrlResponseBody/data.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryShortUrlResponseBody/data.php deleted file mode 100644 index 377f8ec..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QueryShortUrlResponseBody/data.php +++ /dev/null @@ -1,131 +0,0 @@ - 'CreateDate', - 'expireDate' => 'ExpireDate', - 'pageViewCount' => 'PageViewCount', - 'shortUrl' => 'ShortUrl', - 'shortUrlName' => 'ShortUrlName', - 'shortUrlStatus' => 'ShortUrlStatus', - 'sourceUrl' => 'SourceUrl', - 'uniqueVisitorCount' => 'UniqueVisitorCount', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->createDate) { - $res['CreateDate'] = $this->createDate; - } - if (null !== $this->expireDate) { - $res['ExpireDate'] = $this->expireDate; - } - if (null !== $this->pageViewCount) { - $res['PageViewCount'] = $this->pageViewCount; - } - if (null !== $this->shortUrl) { - $res['ShortUrl'] = $this->shortUrl; - } - if (null !== $this->shortUrlName) { - $res['ShortUrlName'] = $this->shortUrlName; - } - if (null !== $this->shortUrlStatus) { - $res['ShortUrlStatus'] = $this->shortUrlStatus; - } - if (null !== $this->sourceUrl) { - $res['SourceUrl'] = $this->sourceUrl; - } - if (null !== $this->uniqueVisitorCount) { - $res['UniqueVisitorCount'] = $this->uniqueVisitorCount; - } - - return $res; - } - - /** - * @param array $map - * - * @return data - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['CreateDate'])) { - $model->createDate = $map['CreateDate']; - } - if (isset($map['ExpireDate'])) { - $model->expireDate = $map['ExpireDate']; - } - if (isset($map['PageViewCount'])) { - $model->pageViewCount = $map['PageViewCount']; - } - if (isset($map['ShortUrl'])) { - $model->shortUrl = $map['ShortUrl']; - } - if (isset($map['ShortUrlName'])) { - $model->shortUrlName = $map['ShortUrlName']; - } - if (isset($map['ShortUrlStatus'])) { - $model->shortUrlStatus = $map['ShortUrlStatus']; - } - if (isset($map['SourceUrl'])) { - $model->sourceUrl = $map['SourceUrl']; - } - if (isset($map['UniqueVisitorCount'])) { - $model->uniqueVisitorCount = $map['UniqueVisitorCount']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsSignRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsSignRequest.php deleted file mode 100644 index fbf1450..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsSignRequest.php +++ /dev/null @@ -1,83 +0,0 @@ - 'OwnerId', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'signName' => 'SignName', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->signName) { - $res['SignName'] = $this->signName; - } - - return $res; - } - - /** - * @param array $map - * - * @return QuerySmsSignRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['SignName'])) { - $model->signName = $map['SignName']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsSignResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsSignResponse.php deleted file mode 100644 index a2652c5..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsSignResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return QuerySmsSignResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = QuerySmsSignResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsSignResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsSignResponseBody.php deleted file mode 100644 index e2e28d7..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsSignResponseBody.php +++ /dev/null @@ -1,119 +0,0 @@ - 'Code', - 'createDate' => 'CreateDate', - 'message' => 'Message', - 'reason' => 'Reason', - 'requestId' => 'RequestId', - 'signName' => 'SignName', - 'signStatus' => 'SignStatus', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->createDate) { - $res['CreateDate'] = $this->createDate; - } - if (null !== $this->message) { - $res['Message'] = $this->message; - } - if (null !== $this->reason) { - $res['Reason'] = $this->reason; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - if (null !== $this->signName) { - $res['SignName'] = $this->signName; - } - if (null !== $this->signStatus) { - $res['SignStatus'] = $this->signStatus; - } - - return $res; - } - - /** - * @param array $map - * - * @return QuerySmsSignResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['CreateDate'])) { - $model->createDate = $map['CreateDate']; - } - if (isset($map['Message'])) { - $model->message = $map['Message']; - } - if (isset($map['Reason'])) { - $model->reason = $map['Reason']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - if (isset($map['SignName'])) { - $model->signName = $map['SignName']; - } - if (isset($map['SignStatus'])) { - $model->signStatus = $map['SignStatus']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsTemplateRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsTemplateRequest.php deleted file mode 100644 index 9d5305b..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsTemplateRequest.php +++ /dev/null @@ -1,83 +0,0 @@ - 'OwnerId', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'templateCode' => 'TemplateCode', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->templateCode) { - $res['TemplateCode'] = $this->templateCode; - } - - return $res; - } - - /** - * @param array $map - * - * @return QuerySmsTemplateRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['TemplateCode'])) { - $model->templateCode = $map['TemplateCode']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsTemplateResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsTemplateResponse.php deleted file mode 100644 index 1cfd968..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsTemplateResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return QuerySmsTemplateResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = QuerySmsTemplateResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsTemplateResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsTemplateResponseBody.php deleted file mode 100644 index 157a1cd..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/QuerySmsTemplateResponseBody.php +++ /dev/null @@ -1,155 +0,0 @@ - 'Code', - 'createDate' => 'CreateDate', - 'message' => 'Message', - 'reason' => 'Reason', - 'requestId' => 'RequestId', - 'templateCode' => 'TemplateCode', - 'templateContent' => 'TemplateContent', - 'templateName' => 'TemplateName', - 'templateStatus' => 'TemplateStatus', - 'templateType' => 'TemplateType', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->createDate) { - $res['CreateDate'] = $this->createDate; - } - if (null !== $this->message) { - $res['Message'] = $this->message; - } - if (null !== $this->reason) { - $res['Reason'] = $this->reason; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - if (null !== $this->templateCode) { - $res['TemplateCode'] = $this->templateCode; - } - if (null !== $this->templateContent) { - $res['TemplateContent'] = $this->templateContent; - } - if (null !== $this->templateName) { - $res['TemplateName'] = $this->templateName; - } - if (null !== $this->templateStatus) { - $res['TemplateStatus'] = $this->templateStatus; - } - if (null !== $this->templateType) { - $res['TemplateType'] = $this->templateType; - } - - return $res; - } - - /** - * @param array $map - * - * @return QuerySmsTemplateResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['CreateDate'])) { - $model->createDate = $map['CreateDate']; - } - if (isset($map['Message'])) { - $model->message = $map['Message']; - } - if (isset($map['Reason'])) { - $model->reason = $map['Reason']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - if (isset($map['TemplateCode'])) { - $model->templateCode = $map['TemplateCode']; - } - if (isset($map['TemplateContent'])) { - $model->templateContent = $map['TemplateContent']; - } - if (isset($map['TemplateName'])) { - $model->templateName = $map['TemplateName']; - } - if (isset($map['TemplateStatus'])) { - $model->templateStatus = $map['TemplateStatus']; - } - if (isset($map['TemplateType'])) { - $model->templateType = $map['TemplateType']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendBatchSmsRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendBatchSmsRequest.php deleted file mode 100644 index 54f89f9..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendBatchSmsRequest.php +++ /dev/null @@ -1,131 +0,0 @@ - 'OwnerId', - 'phoneNumberJson' => 'PhoneNumberJson', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'signNameJson' => 'SignNameJson', - 'smsUpExtendCodeJson' => 'SmsUpExtendCodeJson', - 'templateCode' => 'TemplateCode', - 'templateParamJson' => 'TemplateParamJson', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->phoneNumberJson) { - $res['PhoneNumberJson'] = $this->phoneNumberJson; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->signNameJson) { - $res['SignNameJson'] = $this->signNameJson; - } - if (null !== $this->smsUpExtendCodeJson) { - $res['SmsUpExtendCodeJson'] = $this->smsUpExtendCodeJson; - } - if (null !== $this->templateCode) { - $res['TemplateCode'] = $this->templateCode; - } - if (null !== $this->templateParamJson) { - $res['TemplateParamJson'] = $this->templateParamJson; - } - - return $res; - } - - /** - * @param array $map - * - * @return SendBatchSmsRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['PhoneNumberJson'])) { - $model->phoneNumberJson = $map['PhoneNumberJson']; - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['SignNameJson'])) { - $model->signNameJson = $map['SignNameJson']; - } - if (isset($map['SmsUpExtendCodeJson'])) { - $model->smsUpExtendCodeJson = $map['SmsUpExtendCodeJson']; - } - if (isset($map['TemplateCode'])) { - $model->templateCode = $map['TemplateCode']; - } - if (isset($map['TemplateParamJson'])) { - $model->templateParamJson = $map['TemplateParamJson']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendBatchSmsResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendBatchSmsResponse.php deleted file mode 100644 index 272c4c4..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendBatchSmsResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return SendBatchSmsResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = SendBatchSmsResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendBatchSmsResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendBatchSmsResponseBody.php deleted file mode 100644 index 9164f66..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendBatchSmsResponseBody.php +++ /dev/null @@ -1,83 +0,0 @@ - 'BizId', - 'code' => 'Code', - 'message' => 'Message', - 'requestId' => 'RequestId', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->bizId) { - $res['BizId'] = $this->bizId; - } - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->message) { - $res['Message'] = $this->message; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - - return $res; - } - - /** - * @param array $map - * - * @return SendBatchSmsResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['BizId'])) { - $model->bizId = $map['BizId']; - } - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Message'])) { - $model->message = $map['Message']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsRequest.php deleted file mode 100644 index 1a4dd98..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsRequest.php +++ /dev/null @@ -1,168 +0,0 @@ - 'CardObjects', - 'cardTemplateCode' => 'CardTemplateCode', - 'digitalTemplateCode' => 'DigitalTemplateCode', - 'digitalTemplateParam' => 'DigitalTemplateParam', - 'fallbackType' => 'FallbackType', - 'outId' => 'OutId', - 'signName' => 'SignName', - 'smsTemplateCode' => 'SmsTemplateCode', - 'smsTemplateParam' => 'SmsTemplateParam', - 'smsUpExtendCode' => 'SmsUpExtendCode', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->cardObjects) { - $res['CardObjects'] = []; - if (null !== $this->cardObjects && \is_array($this->cardObjects)) { - $n = 0; - foreach ($this->cardObjects as $item) { - $res['CardObjects'][$n++] = null !== $item ? $item->toMap() : $item; - } - } - } - if (null !== $this->cardTemplateCode) { - $res['CardTemplateCode'] = $this->cardTemplateCode; - } - if (null !== $this->digitalTemplateCode) { - $res['DigitalTemplateCode'] = $this->digitalTemplateCode; - } - if (null !== $this->digitalTemplateParam) { - $res['DigitalTemplateParam'] = $this->digitalTemplateParam; - } - if (null !== $this->fallbackType) { - $res['FallbackType'] = $this->fallbackType; - } - if (null !== $this->outId) { - $res['OutId'] = $this->outId; - } - if (null !== $this->signName) { - $res['SignName'] = $this->signName; - } - if (null !== $this->smsTemplateCode) { - $res['SmsTemplateCode'] = $this->smsTemplateCode; - } - if (null !== $this->smsTemplateParam) { - $res['SmsTemplateParam'] = $this->smsTemplateParam; - } - if (null !== $this->smsUpExtendCode) { - $res['SmsUpExtendCode'] = $this->smsUpExtendCode; - } - - return $res; - } - - /** - * @param array $map - * - * @return SendCardSmsRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['CardObjects'])) { - if (!empty($map['CardObjects'])) { - $model->cardObjects = []; - $n = 0; - foreach ($map['CardObjects'] as $item) { - $model->cardObjects[$n++] = null !== $item ? cardObjects::fromMap($item) : $item; - } - } - } - if (isset($map['CardTemplateCode'])) { - $model->cardTemplateCode = $map['CardTemplateCode']; - } - if (isset($map['DigitalTemplateCode'])) { - $model->digitalTemplateCode = $map['DigitalTemplateCode']; - } - if (isset($map['DigitalTemplateParam'])) { - $model->digitalTemplateParam = $map['DigitalTemplateParam']; - } - if (isset($map['FallbackType'])) { - $model->fallbackType = $map['FallbackType']; - } - if (isset($map['OutId'])) { - $model->outId = $map['OutId']; - } - if (isset($map['SignName'])) { - $model->signName = $map['SignName']; - } - if (isset($map['SmsTemplateCode'])) { - $model->smsTemplateCode = $map['SmsTemplateCode']; - } - if (isset($map['SmsTemplateParam'])) { - $model->smsTemplateParam = $map['SmsTemplateParam']; - } - if (isset($map['SmsUpExtendCode'])) { - $model->smsUpExtendCode = $map['SmsUpExtendCode']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsRequest/cardObjects.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsRequest/cardObjects.php deleted file mode 100644 index 3a451fe..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsRequest/cardObjects.php +++ /dev/null @@ -1,71 +0,0 @@ - 'customUrl', - 'dyncParams' => 'dyncParams', - 'mobile' => 'mobile', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->customUrl) { - $res['customUrl'] = $this->customUrl; - } - if (null !== $this->dyncParams) { - $res['dyncParams'] = $this->dyncParams; - } - if (null !== $this->mobile) { - $res['mobile'] = $this->mobile; - } - - return $res; - } - - /** - * @param array $map - * - * @return cardObjects - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['customUrl'])) { - $model->customUrl = $map['customUrl']; - } - if (isset($map['dyncParams'])) { - $model->dyncParams = $map['dyncParams']; - } - if (isset($map['mobile'])) { - $model->mobile = $map['mobile']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsResponse.php deleted file mode 100644 index 0926067..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return SendCardSmsResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = SendCardSmsResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsResponseBody.php deleted file mode 100644 index 4a2d2ba..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsResponseBody.php +++ /dev/null @@ -1,84 +0,0 @@ - 'Code', - 'data' => 'Data', - 'requestId' => 'RequestId', - 'success' => 'Success', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->data) { - $res['Data'] = null !== $this->data ? $this->data->toMap() : null; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - if (null !== $this->success) { - $res['Success'] = $this->success; - } - - return $res; - } - - /** - * @param array $map - * - * @return SendCardSmsResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Data'])) { - $model->data = data::fromMap($map['Data']); - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - if (isset($map['Success'])) { - $model->success = $map['Success']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsResponseBody/data.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsResponseBody/data.php deleted file mode 100644 index 520ef7c..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendCardSmsResponseBody/data.php +++ /dev/null @@ -1,107 +0,0 @@ - 'BizCardId', - 'bizDigitalId' => 'BizDigitalId', - 'bizSmsId' => 'BizSmsId', - 'cardTmpState' => 'CardTmpState', - 'mediaMobiles' => 'MediaMobiles', - 'notMediaMobiles' => 'NotMediaMobiles', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->bizCardId) { - $res['BizCardId'] = $this->bizCardId; - } - if (null !== $this->bizDigitalId) { - $res['BizDigitalId'] = $this->bizDigitalId; - } - if (null !== $this->bizSmsId) { - $res['BizSmsId'] = $this->bizSmsId; - } - if (null !== $this->cardTmpState) { - $res['CardTmpState'] = $this->cardTmpState; - } - if (null !== $this->mediaMobiles) { - $res['MediaMobiles'] = $this->mediaMobiles; - } - if (null !== $this->notMediaMobiles) { - $res['NotMediaMobiles'] = $this->notMediaMobiles; - } - - return $res; - } - - /** - * @param array $map - * - * @return data - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['BizCardId'])) { - $model->bizCardId = $map['BizCardId']; - } - if (isset($map['BizDigitalId'])) { - $model->bizDigitalId = $map['BizDigitalId']; - } - if (isset($map['BizSmsId'])) { - $model->bizSmsId = $map['BizSmsId']; - } - if (isset($map['CardTmpState'])) { - $model->cardTmpState = $map['CardTmpState']; - } - if (isset($map['MediaMobiles'])) { - $model->mediaMobiles = $map['MediaMobiles']; - } - if (isset($map['NotMediaMobiles'])) { - $model->notMediaMobiles = $map['NotMediaMobiles']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendSmsRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendSmsRequest.php deleted file mode 100644 index 57d882b..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendSmsRequest.php +++ /dev/null @@ -1,143 +0,0 @@ - 'OutId', - 'ownerId' => 'OwnerId', - 'phoneNumbers' => 'PhoneNumbers', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'signName' => 'SignName', - 'smsUpExtendCode' => 'SmsUpExtendCode', - 'templateCode' => 'TemplateCode', - 'templateParam' => 'TemplateParam', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->outId) { - $res['OutId'] = $this->outId; - } - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->phoneNumbers) { - $res['PhoneNumbers'] = $this->phoneNumbers; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->signName) { - $res['SignName'] = $this->signName; - } - if (null !== $this->smsUpExtendCode) { - $res['SmsUpExtendCode'] = $this->smsUpExtendCode; - } - if (null !== $this->templateCode) { - $res['TemplateCode'] = $this->templateCode; - } - if (null !== $this->templateParam) { - $res['TemplateParam'] = $this->templateParam; - } - - return $res; - } - - /** - * @param array $map - * - * @return SendSmsRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['OutId'])) { - $model->outId = $map['OutId']; - } - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['PhoneNumbers'])) { - $model->phoneNumbers = $map['PhoneNumbers']; - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['SignName'])) { - $model->signName = $map['SignName']; - } - if (isset($map['SmsUpExtendCode'])) { - $model->smsUpExtendCode = $map['SmsUpExtendCode']; - } - if (isset($map['TemplateCode'])) { - $model->templateCode = $map['TemplateCode']; - } - if (isset($map['TemplateParam'])) { - $model->templateParam = $map['TemplateParam']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendSmsResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendSmsResponse.php deleted file mode 100644 index b2eed46..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendSmsResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return SendSmsResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = SendSmsResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendSmsResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendSmsResponseBody.php deleted file mode 100644 index f3b118c..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/SendSmsResponseBody.php +++ /dev/null @@ -1,83 +0,0 @@ - 'BizId', - 'code' => 'Code', - 'message' => 'Message', - 'requestId' => 'RequestId', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->bizId) { - $res['BizId'] = $this->bizId; - } - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->message) { - $res['Message'] = $this->message; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - - return $res; - } - - /** - * @param array $map - * - * @return SendSmsResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['BizId'])) { - $model->bizId = $map['BizId']; - } - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Message'])) { - $model->message = $map['Message']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/TagResourcesRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/TagResourcesRequest.php deleted file mode 100644 index a9d7800..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/TagResourcesRequest.php +++ /dev/null @@ -1,146 +0,0 @@ - 'OwnerId', - 'prodCode' => 'ProdCode', - 'regionId' => 'RegionId', - 'resourceId' => 'ResourceId', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'resourceType' => 'ResourceType', - 'tag' => 'Tag', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->prodCode) { - $res['ProdCode'] = $this->prodCode; - } - if (null !== $this->regionId) { - $res['RegionId'] = $this->regionId; - } - if (null !== $this->resourceId) { - $res['ResourceId'] = $this->resourceId; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->resourceType) { - $res['ResourceType'] = $this->resourceType; - } - if (null !== $this->tag) { - $res['Tag'] = []; - if (null !== $this->tag && \is_array($this->tag)) { - $n = 0; - foreach ($this->tag as $item) { - $res['Tag'][$n++] = null !== $item ? $item->toMap() : $item; - } - } - } - - return $res; - } - - /** - * @param array $map - * - * @return TagResourcesRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['ProdCode'])) { - $model->prodCode = $map['ProdCode']; - } - if (isset($map['RegionId'])) { - $model->regionId = $map['RegionId']; - } - if (isset($map['ResourceId'])) { - if (!empty($map['ResourceId'])) { - $model->resourceId = $map['ResourceId']; - } - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['ResourceType'])) { - $model->resourceType = $map['ResourceType']; - } - if (isset($map['Tag'])) { - if (!empty($map['Tag'])) { - $model->tag = []; - $n = 0; - foreach ($map['Tag'] as $item) { - $model->tag[$n++] = null !== $item ? tag::fromMap($item) : $item; - } - } - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/TagResourcesRequest/tag.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/TagResourcesRequest/tag.php deleted file mode 100644 index beb7bb8..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/TagResourcesRequest/tag.php +++ /dev/null @@ -1,59 +0,0 @@ - 'Key', - 'value' => 'Value', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->key) { - $res['Key'] = $this->key; - } - if (null !== $this->value) { - $res['Value'] = $this->value; - } - - return $res; - } - - /** - * @param array $map - * - * @return tag - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Key'])) { - $model->key = $map['Key']; - } - if (isset($map['Value'])) { - $model->value = $map['Value']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/TagResourcesResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/TagResourcesResponse.php deleted file mode 100644 index b349883..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/TagResourcesResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return TagResourcesResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = TagResourcesResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/TagResourcesResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/TagResourcesResponseBody.php deleted file mode 100644 index ad5e550..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/TagResourcesResponseBody.php +++ /dev/null @@ -1,71 +0,0 @@ - 'Code', - 'data' => 'Data', - 'requestId' => 'RequestId', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->data) { - $res['Data'] = $this->data; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - - return $res; - } - - /** - * @param array $map - * - * @return TagResourcesResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Data'])) { - $model->data = $map['Data']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/UntagResourcesRequest.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/UntagResourcesRequest.php deleted file mode 100644 index 64a00d4..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/UntagResourcesRequest.php +++ /dev/null @@ -1,147 +0,0 @@ - 'All', - 'ownerId' => 'OwnerId', - 'prodCode' => 'ProdCode', - 'regionId' => 'RegionId', - 'resourceId' => 'ResourceId', - 'resourceOwnerAccount' => 'ResourceOwnerAccount', - 'resourceOwnerId' => 'ResourceOwnerId', - 'resourceType' => 'ResourceType', - 'tagKey' => 'TagKey', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->all) { - $res['All'] = $this->all; - } - if (null !== $this->ownerId) { - $res['OwnerId'] = $this->ownerId; - } - if (null !== $this->prodCode) { - $res['ProdCode'] = $this->prodCode; - } - if (null !== $this->regionId) { - $res['RegionId'] = $this->regionId; - } - if (null !== $this->resourceId) { - $res['ResourceId'] = $this->resourceId; - } - if (null !== $this->resourceOwnerAccount) { - $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; - } - if (null !== $this->resourceOwnerId) { - $res['ResourceOwnerId'] = $this->resourceOwnerId; - } - if (null !== $this->resourceType) { - $res['ResourceType'] = $this->resourceType; - } - if (null !== $this->tagKey) { - $res['TagKey'] = $this->tagKey; - } - - return $res; - } - - /** - * @param array $map - * - * @return UntagResourcesRequest - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['All'])) { - $model->all = $map['All']; - } - if (isset($map['OwnerId'])) { - $model->ownerId = $map['OwnerId']; - } - if (isset($map['ProdCode'])) { - $model->prodCode = $map['ProdCode']; - } - if (isset($map['RegionId'])) { - $model->regionId = $map['RegionId']; - } - if (isset($map['ResourceId'])) { - if (!empty($map['ResourceId'])) { - $model->resourceId = $map['ResourceId']; - } - } - if (isset($map['ResourceOwnerAccount'])) { - $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; - } - if (isset($map['ResourceOwnerId'])) { - $model->resourceOwnerId = $map['ResourceOwnerId']; - } - if (isset($map['ResourceType'])) { - $model->resourceType = $map['ResourceType']; - } - if (isset($map['TagKey'])) { - if (!empty($map['TagKey'])) { - $model->tagKey = $map['TagKey']; - } - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/UntagResourcesResponse.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/UntagResourcesResponse.php deleted file mode 100644 index 36543c7..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/UntagResourcesResponse.php +++ /dev/null @@ -1,61 +0,0 @@ - 'headers', - 'body' => 'body', - ]; - - public function validate() - { - Model::validateRequired('headers', $this->headers, true); - Model::validateRequired('body', $this->body, true); - } - - public function toMap() - { - $res = []; - if (null !== $this->headers) { - $res['headers'] = $this->headers; - } - if (null !== $this->body) { - $res['body'] = null !== $this->body ? $this->body->toMap() : null; - } - - return $res; - } - - /** - * @param array $map - * - * @return UntagResourcesResponse - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['headers'])) { - $model->headers = $map['headers']; - } - if (isset($map['body'])) { - $model->body = UntagResourcesResponseBody::fromMap($map['body']); - } - - return $model; - } -} diff --git a/vendor/alibabacloud/dysmsapi-20170525/src/Models/UntagResourcesResponseBody.php b/vendor/alibabacloud/dysmsapi-20170525/src/Models/UntagResourcesResponseBody.php deleted file mode 100644 index 3b6b8e7..0000000 --- a/vendor/alibabacloud/dysmsapi-20170525/src/Models/UntagResourcesResponseBody.php +++ /dev/null @@ -1,71 +0,0 @@ - 'Code', - 'data' => 'Data', - 'requestId' => 'RequestId', - ]; - - public function validate() - { - } - - public function toMap() - { - $res = []; - if (null !== $this->code) { - $res['Code'] = $this->code; - } - if (null !== $this->data) { - $res['Data'] = $this->data; - } - if (null !== $this->requestId) { - $res['RequestId'] = $this->requestId; - } - - return $res; - } - - /** - * @param array $map - * - * @return UntagResourcesResponseBody - */ - public static function fromMap($map = []) - { - $model = new self(); - if (isset($map['Code'])) { - $model->code = $map['Code']; - } - if (isset($map['Data'])) { - $model->data = $map['Data']; - } - if (isset($map['RequestId'])) { - $model->requestId = $map['RequestId']; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/endpoint-util/.gitignore b/vendor/alibabacloud/endpoint-util/.gitignore deleted file mode 100644 index 0ee6c28..0000000 --- a/vendor/alibabacloud/endpoint-util/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -composer.phar -/vendor/ - -# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control -# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -composer.lock - -.idea -.DS_Store - -cache/ -*.cache -runtime/ diff --git a/vendor/alibabacloud/endpoint-util/.php_cs.dist b/vendor/alibabacloud/endpoint-util/.php_cs.dist deleted file mode 100644 index 8617ec2..0000000 --- a/vendor/alibabacloud/endpoint-util/.php_cs.dist +++ /dev/null @@ -1,65 +0,0 @@ -setRiskyAllowed(true) - ->setIndent(' ') - ->setRules([ - '@PSR2' => true, - '@PhpCsFixer' => true, - '@Symfony:risky' => true, - 'concat_space' => ['spacing' => 'one'], - 'array_syntax' => ['syntax' => 'short'], - 'array_indentation' => true, - 'combine_consecutive_unsets' => true, - 'method_separation' => true, - 'single_quote' => true, - 'declare_equal_normalize' => true, - 'function_typehint_space' => true, - 'hash_to_slash_comment' => true, - 'include' => true, - 'lowercase_cast' => true, - 'no_multiline_whitespace_before_semicolons' => true, - 'no_leading_import_slash' => true, - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_spaces_around_offset' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unused_imports' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'object_operator_without_whitespace' => true, - 'single_blank_line_before_namespace' => true, - 'single_class_element_per_statement' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'whitespace_after_comma_in_array' => true, - 'no_extra_consecutive_blank_lines' => [ - 'curly_brace_block', - 'extra', - 'parenthesis_brace_block', - 'square_brace_block', - 'throw', - 'use', - ], - 'binary_operator_spaces' => [ - 'align_double_arrow' => true, - 'align_equals' => true, - ], - 'braces' => [ - 'allow_single_line_closure' => true, - ], - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude('vendor') - ->exclude('tests') - ->in(__DIR__) - ); diff --git a/vendor/alibabacloud/endpoint-util/LICENSE b/vendor/alibabacloud/endpoint-util/LICENSE deleted file mode 100644 index ec13fcc..0000000 --- a/vendor/alibabacloud/endpoint-util/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2009-present, Alibaba Cloud All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/vendor/alibabacloud/endpoint-util/README-CN.md b/vendor/alibabacloud/endpoint-util/README-CN.md deleted file mode 100644 index 80374a4..0000000 --- a/vendor/alibabacloud/endpoint-util/README-CN.md +++ /dev/null @@ -1,31 +0,0 @@ -English | [简体中文](README-CN.md) - -![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg) - -## Alibaba Cloud Endpoint Library for PHP - -## Installation - -### Composer - -```bash -composer require alibabacloud/endpoint-util -``` - -## Issues - -[Opening an Issue](https://github.com/aliyun/endpoint-util/issues/new), Issues not conforming to the guidelines may be closed immediately. - -## Changelog - -Detailed changes for each release are documented in the [release notes](./ChangeLog.txt). - -## References - -* [Latest Release](https://github.com/aliyun/endpoint-util) - -## License - -[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) - -Copyright (c) 2009-present, Alibaba Cloud All rights reserved. diff --git a/vendor/alibabacloud/endpoint-util/README.md b/vendor/alibabacloud/endpoint-util/README.md deleted file mode 100644 index 3cd5898..0000000 --- a/vendor/alibabacloud/endpoint-util/README.md +++ /dev/null @@ -1,31 +0,0 @@ -[English](README.md) | 简体中文 - -![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg) - -## Alibaba Cloud Endpoint Library for PHP - -## 安装 - -### Composer - -```bash -composer require alibabacloud/endpoint-util -``` - -## 问题 - -[提交 Issue](https://github.com/aliyun/endpoint-util/issues/new),不符合指南的问题可能会立即关闭。 - -## 发行说明 - -每个版本的详细更改记录在[发行说明](./ChangeLog.txt)中。 - -## 相关 - -* [最新源码](https://github.com/aliyun/endpoint-util) - -## 许可证 - -[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) - -Copyright (c) 2009-present, Alibaba Cloud All rights reserved. diff --git a/vendor/alibabacloud/endpoint-util/composer.json b/vendor/alibabacloud/endpoint-util/composer.json deleted file mode 100644 index d22ce33..0000000 --- a/vendor/alibabacloud/endpoint-util/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "alibabacloud/endpoint-util", - "description": "Alibaba Cloud Endpoint Library for PHP", - "type": "library", - "license": "Apache-2.0", - "authors": [ - { - "name": "Alibaba Cloud SDK", - "email": "sdk-team@alibabacloud.com" - } - ], - "require": { - "php": ">5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35|^5.4.3" - }, - "autoload": { - "psr-4": { - "AlibabaCloud\\Endpoint\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "AlibabaCloud\\Endpoint\\Tests\\": "tests" - } - }, - "scripts": { - "fixer": "php-cs-fixer fix ./", - "test": [ - "@clearCache", - "./vendor/bin/phpunit --colors=always" - ], - "clearCache": "rm -rf cache/*" - }, - "config": { - "sort-packages": true, - "preferred-install": "dist", - "optimize-autoloader": true - }, - "prefer-stable": true -} \ No newline at end of file diff --git a/vendor/alibabacloud/endpoint-util/phpunit.xml b/vendor/alibabacloud/endpoint-util/phpunit.xml deleted file mode 100644 index 8306a79..0000000 --- a/vendor/alibabacloud/endpoint-util/phpunit.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - tests - - - ./tests/Unit - - - - - - integration - - - - - - - - - - - - ./src - - - diff --git a/vendor/alibabacloud/endpoint-util/src/Endpoint.php b/vendor/alibabacloud/endpoint-util/src/Endpoint.php deleted file mode 100644 index 5afa676..0000000 --- a/vendor/alibabacloud/endpoint-util/src/Endpoint.php +++ /dev/null @@ -1,61 +0,0 @@ -..aliyuncs.com'; - const CENTRAL_RULES = '.aliyuncs.com'; - - /** - * @param string $product required - * @param string $regionId optional It will be required when endpoint type is 'regional' - * @param string $endpointType optional regional|central - * @param string $network optional - * @param string $suffix optional - * - * @throws \InvalidArgumentException - * - * @return string - */ - public static function getEndpointRules($product, $regionId, $endpointType = '', $network = '', $suffix = '') - { - if (empty($product)) { - throw new \InvalidArgumentException('Product name cannot be empty.'); - } - $endpoint = self::REGIONAL_RULES; - if (self::ENDPOINT_TYPE_REGIONAL === $endpointType) { - if (empty($regionId)) { - throw new \InvalidArgumentException('RegionId is empty, please set a valid RegionId'); - } - $endpoint = self::render($endpoint, 'region_id', strtolower($regionId)); - } elseif (self::ENDPOINT_TYPE_CENTRAL === $endpointType) { - $endpoint = self::CENTRAL_RULES; - } else { - throw new \InvalidArgumentException('Invalid EndpointType'); - } - if (!empty($network) && 'public' !== $network) { - $endpoint = self::render($endpoint, 'network', '-' . $network); - } else { - $endpoint = self::render($endpoint, 'network', ''); - } - if (!empty($suffix)) { - $endpoint = self::render($endpoint, 'suffix', '-' . $suffix); - } else { - $endpoint = self::render($endpoint, 'suffix', ''); - } - - return self::render($endpoint, 'product', strtolower($product)); - } - - private static function render($str, $tag, $replace) - { - return str_replace('<' . $tag . '>', $replace, $str); - } -} diff --git a/vendor/alibabacloud/endpoint-util/tests/EndpointTest.php b/vendor/alibabacloud/endpoint-util/tests/EndpointTest.php deleted file mode 100644 index e21dcd4..0000000 --- a/vendor/alibabacloud/endpoint-util/tests/EndpointTest.php +++ /dev/null @@ -1,58 +0,0 @@ -expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Product name cannot be empty.'); - Endpoint::getEndpointRules('', '', '', ''); - } - - public function testGetEndpointWhenInvalidEndpointType() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid EndpointType'); - Endpoint::getEndpointRules('ecs', '', 'fake endpoint type', ''); - } - - public function testGetEndpointWhenInvalidRegionId() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('RegionId is empty, please set a valid RegionId'); - Endpoint::getEndpointRules('ecs', '', Endpoint::ENDPOINT_TYPE_REGIONAL, ''); - } - - public function testGetEndpointCentral() - { - $endpoint = Endpoint::getEndpointRules('ecs', '', Endpoint::ENDPOINT_TYPE_CENTRAL); - $this->assertEquals('ecs.aliyuncs.com', $endpoint); - } - - public function testGetEndpointRegional() - { - $endpoint = Endpoint::getEndpointRules('ecs', 'cn-hangzhou', Endpoint::ENDPOINT_TYPE_REGIONAL); - $this->assertEquals('ecs.cn-hangzhou.aliyuncs.com', $endpoint); - } - - public function testGetEndpointRegionalWithNetwork() - { - $endpoint = Endpoint::getEndpointRules('ecs', 'cn-hangzhou', Endpoint::ENDPOINT_TYPE_REGIONAL, 'internal'); - $this->assertEquals('ecs-internal.cn-hangzhou.aliyuncs.com', $endpoint); - } - - public function testGetEndpointRegionalWithSuffix() - { - $endpoint = Endpoint::getEndpointRules('ecs', 'cn-hangzhou', Endpoint::ENDPOINT_TYPE_REGIONAL, 'internal', 'test'); - $this->assertEquals('ecs-test-internal.cn-hangzhou.aliyuncs.com', $endpoint); - } -} diff --git a/vendor/alibabacloud/endpoint-util/tests/bootstrap.php b/vendor/alibabacloud/endpoint-util/tests/bootstrap.php deleted file mode 100644 index c62c4e8..0000000 --- a/vendor/alibabacloud/endpoint-util/tests/bootstrap.php +++ /dev/null @@ -1,3 +0,0 @@ -setRiskyAllowed(true) - ->setIndent(' ') - ->setRules([ - '@PSR2' => true, - '@PhpCsFixer' => true, - '@Symfony:risky' => true, - 'concat_space' => ['spacing' => 'one'], - 'array_syntax' => ['syntax' => 'short'], - 'array_indentation' => true, - 'combine_consecutive_unsets' => true, - 'method_separation' => true, - 'single_quote' => true, - 'declare_equal_normalize' => true, - 'function_typehint_space' => true, - 'hash_to_slash_comment' => true, - 'include' => true, - 'lowercase_cast' => true, - 'no_multiline_whitespace_before_semicolons' => true, - 'no_leading_import_slash' => true, - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_spaces_around_offset' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unused_imports' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'object_operator_without_whitespace' => true, - 'single_blank_line_before_namespace' => true, - 'single_class_element_per_statement' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'whitespace_after_comma_in_array' => true, - 'no_extra_consecutive_blank_lines' => [ - 'curly_brace_block', - 'extra', - 'parenthesis_brace_block', - 'square_brace_block', - 'throw', - 'use', - ], - 'binary_operator_spaces' => [ - 'align_double_arrow' => true, - 'align_equals' => true, - ], - 'braces' => [ - 'allow_single_line_closure' => true, - ], - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude('vendor') - ->exclude('tests') - ->in(__DIR__) - ); diff --git a/vendor/alibabacloud/openapi-util/README-CN.md b/vendor/alibabacloud/openapi-util/README-CN.md deleted file mode 100644 index 57b03a4..0000000 --- a/vendor/alibabacloud/openapi-util/README-CN.md +++ /dev/null @@ -1,31 +0,0 @@ -[English](README.md) | 简体中文 - -![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg) - -## Alibaba Cloud OpenApi Util - -## 安装 - -### Composer - -```bash -composer require alibabacloud/openapi-util -``` - -## 问题 - -[提交 Issue](https://github.com/aliyun/openapiutil/issues/new),不符合指南的问题可能会立即关闭。 - -## 发行说明 - -每个版本的详细更改记录在[发行说明](./ChangeLog.txt)中。 - -## 相关 - -* [最新源码](https://github.com/aliyun/openapiutil) - -## 许可证 - -[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) - -Copyright (c) 2009-present, Alibaba Cloud All rights reserved. diff --git a/vendor/alibabacloud/openapi-util/README.md b/vendor/alibabacloud/openapi-util/README.md deleted file mode 100644 index 2ad0472..0000000 --- a/vendor/alibabacloud/openapi-util/README.md +++ /dev/null @@ -1,31 +0,0 @@ -English | [简体中文](README-CN.md) - -![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg) - -## Alibaba Cloud OpenApi Util - -## Installation - -### Composer - -```bash -composer require alibabacloud/openapi-util -``` - -## Issues - -[Opening an Issue](https://github.com/aliyun/openapiutil/issues/new), Issues not conforming to the guidelines may be closed immediately. - -## Changelog - -Detailed changes for each release are documented in the [release notes](./ChangeLog.txt). - -## References - -* [Latest Release](https://github.com/aliyun/openapiutil) - -## License - -[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) - -Copyright (c) 2009-present, Alibaba Cloud All rights reserved. diff --git a/vendor/alibabacloud/openapi-util/autoload.php b/vendor/alibabacloud/openapi-util/autoload.php deleted file mode 100644 index b787ba0..0000000 --- a/vendor/alibabacloud/openapi-util/autoload.php +++ /dev/null @@ -1,17 +0,0 @@ -5.5", - "alibabacloud/tea": "^3.1", - "alibabacloud/tea-utils": "^0.2", - "lizhichao/one-sm": "^1.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35|^5.4.3" - }, - "autoload": { - "psr-4": { - "AlibabaCloud\\OpenApiUtil\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "AlibabaCloud\\OpenApiUtil\\Tests\\": "tests" - } - }, - "scripts": { - "fixer": "php-cs-fixer fix ./", - "test": [ - "@clearCache", - "./vendor/bin/phpunit --colors=always" - ], - "clearCache": "rm -rf cache/*" - }, - "config": { - "sort-packages": true, - "preferred-install": "dist", - "optimize-autoloader": true - }, - "prefer-stable": true -} diff --git a/vendor/alibabacloud/openapi-util/phpunit.xml b/vendor/alibabacloud/openapi-util/phpunit.xml deleted file mode 100644 index 796384a..0000000 --- a/vendor/alibabacloud/openapi-util/phpunit.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - tests - - - ./tests/Unit - - - - - - integration - - - - - - - - - - - ./src - - - diff --git a/vendor/alibabacloud/openapi-util/src/OpenApiUtilClient.php b/vendor/alibabacloud/openapi-util/src/OpenApiUtilClient.php deleted file mode 100644 index 8e65a0f..0000000 --- a/vendor/alibabacloud/openapi-util/src/OpenApiUtilClient.php +++ /dev/null @@ -1,542 +0,0 @@ -getProperties(\ReflectionProperty::IS_PUBLIC) as $property) { - $name = $property->getName(); - if (!$property->isStatic()) { - $value = $property->getValue($body); - if ($value instanceof StreamInterface) { - continue; - } - $content->{$name} = $value; - } - } - } - - /** - * Get the string to be signed according to request. - * - * @param Request $request which contains signed messages - * - * @return string the signed string - */ - public static function getStringToSign($request) - { - $pathname = $request->pathname ?: ''; - $query = $request->query ?: []; - - $accept = isset($request->headers['accept']) ? $request->headers['accept'] : ''; - $contentMD5 = isset($request->headers['content-md5']) ? $request->headers['content-md5'] : ''; - $contentType = isset($request->headers['content-type']) ? $request->headers['content-type'] : ''; - $date = isset($request->headers['date']) ? $request->headers['date'] : ''; - - $result = $request->method . "\n" . - $accept . "\n" . - $contentMD5 . "\n" . - $contentType . "\n" . - $date . "\n"; - - $canonicalizedHeaders = self::getCanonicalizedHeaders($request->headers); - $canonicalizedResource = self::getCanonicalizedResource($pathname, $query); - - return $result . $canonicalizedHeaders . $canonicalizedResource; - } - - /** - * Get signature according to stringToSign, secret. - * - * @param string $stringToSign the signed string - * @param string $secret accesskey secret - * - * @return string the signature - */ - public static function getROASignature($stringToSign, $secret) - { - return base64_encode(hash_hmac('sha1', $stringToSign, $secret, true)); - } - - /** - * Parse filter into a form string. - * - * @param array $filter object - * - * @return string the string - */ - public static function toForm($filter) - { - $query = $filter; - if (null === $query) { - return ''; - } - if ($query instanceof Model) { - $query = $query->toMap(); - } - $tmp = []; - foreach ($query as $k => $v) { - if (0 !== strpos($k, '_')) { - $tmp[$k] = $v; - } - } - $res = self::flatten($tmp); - ksort($res); - - return http_build_query($res); - } - - /** - * Get timestamp. - * - * @return string the timestamp string - */ - public static function getTimestamp() - { - return gmdate('Y-m-d\\TH:i:s\\Z'); - } - - /** - * Parse filter into a object which's type is map[string]string. - * - * @param array $filter query param - * - * @return array the object - */ - public static function query($filter) - { - if (null === $filter) { - return []; - } - $dict = $filter; - if ($dict instanceof Model) { - $dict = $dict->toMap(); - } - $tmp = []; - foreach ($dict as $k => $v) { - if (0 !== strpos($k, '_')) { - $tmp[$k] = $v; - } - } - - return self::flatten($tmp); - } - - /** - * Get signature according to signedParams, method and secret. - * - * @param array $signedParams params which need to be signed - * @param string $method http method e.g. GET - * @param string $secret AccessKeySecret - * - * @return string the signature - */ - public static function getRPCSignature($signedParams, $method, $secret) - { - $secret .= '&'; - $strToSign = self::getRpcStrToSign($method, $signedParams); - - $signMethod = 'HMAC-SHA1'; - - return self::encode($signMethod, $strToSign, $secret); - } - - /** - * Parse array into a string with specified style. - * - * @style specified style e.g. repeatList - * - * @param mixed $array the array - * @param string $prefix the prefix string - * @param string $style - * - * @return string the string - */ - public static function arrayToStringWithSpecifiedStyle($array, $prefix, $style) - { - if (null === $array) { - return ''; - } - if ('repeatList' === $style) { - return self::toForm([$prefix => $array]); - } - if ('simple' == $style || 'spaceDelimited' == $style || 'pipeDelimited' == $style) { - $strs = self::flatten($array); - - switch ($style) { - case 'spaceDelimited': - return implode(' ', $strs); - - case 'pipeDelimited': - return implode('|', $strs); - - default: - return implode(',', $strs); - } - } elseif ('json' === $style) { - return json_encode($array); - } - - return ''; - } - - /** - * Transform input as array. - * - * @param mixed $input - * - * @return array - */ - public static function parseToArray($input) - { - self::parse($input, $result); - - return $result; - } - - /** - * Transform input as map. - * - * @param mixed $input - * - * @return array - */ - public static function parseToMap($input) - { - self::parse($input, $result); - - return $result; - } - - public static function getEndpoint($endpoint, $useAccelerate, $endpointType = 'public') - { - if ('internal' == $endpointType) { - $tmp = explode('.', $endpoint); - $tmp[0] .= '-internal'; - $endpoint = implode('.', $tmp); - } - if ($useAccelerate && 'accelerate' == $endpointType) { - return 'oss-accelerate.aliyuncs.com'; - } - - return $endpoint; - } - - /** - * Encode raw with base16. - * - * @param int[] $raw encoding data - * - * @return string encoded string - */ - public static function hexEncode($raw) - { - if (is_array($raw)) { - $raw = Utils::toString($raw); - } - return bin2hex($raw); - } - - /** - * Hash the raw data with signatureAlgorithm. - * - * @param int[] $raw hashing data - * @param string $signatureAlgorithm the autograph method - * - * @return array hashed bytes - */ - public static function hash($raw, $signatureAlgorithm) - { - $str = Utils::toString($raw); - - switch ($signatureAlgorithm) { - case 'ACS3-HMAC-SHA256': - case 'ACS3-RSA-SHA256': - $res = hash('sha256', $str, true); - return Utils::toBytes($res); - case 'ACS3-HMAC-SM3': - $res = self::sm3($str); - return Utils::toBytes(hex2bin($res)); - } - - return []; - } - - /** - * Get the authorization. - * - * @param Request $request request params - * @param string $signatureAlgorithm the autograph method - * @param string $payload the hashed request - * @param string $accesskey the accessKey string - * @param string $accessKeySecret the accessKeySecret string - * - * @return string authorization string - * @throws \ErrorException - * - */ - public static function getAuthorization($request, $signatureAlgorithm, $payload, $accesskey, $accessKeySecret) - { - $canonicalURI = $request->pathname ? $request->pathname : '/'; - - $method = strtoupper($request->method); - $canonicalQueryString = self::getCanonicalQueryString($request->query); - $signHeaders = []; - foreach ($request->headers as $k => $v) { - $k = strtolower($k); - if (0 === strpos($k, 'x-acs-') || 'host' === $k || 'content-type' === $k) { - $signHeaders[$k] = $v; - } - } - ksort($signHeaders); - $headers = []; - foreach ($request->headers as $k => $v) { - $k = strtolower($k); - if (0 === strpos($k, 'x-acs-') || 'host' === $k || 'content-type' === $k) { - $headers[$k] = trim($v); - } - } - $canonicalHeaderString = ''; - ksort($headers); - foreach ($headers as $k => $v) { - $canonicalHeaderString .= $k . ':' . trim(self::filter($v)) . "\n"; - } - if (empty($canonicalHeaderString)) { - $canonicalHeaderString = "\n"; - } - - $canonicalRequest = $method . "\n" . $canonicalURI . "\n" . $canonicalQueryString . "\n" . - $canonicalHeaderString . "\n" . implode(';', array_keys($signHeaders)) . "\n" . $payload; - $strtosign = $signatureAlgorithm . "\n" . self::hexEncode(self::hash(Utils::toBytes($canonicalRequest), $signatureAlgorithm)); - $signature = self::sign($accessKeySecret, $strtosign, $signatureAlgorithm); - $signature = self::hexEncode($signature); - - return $signatureAlgorithm . - ' Credential=' . $accesskey . - ',SignedHeaders=' . implode(';', array_keys($signHeaders)) . - ',Signature=' . $signature; - } - - public static function sign($secret, $str, $algorithm) - { - $result = ''; - switch ($algorithm) { - case 'ACS3-HMAC-SHA256': - $result = hash_hmac('sha256', $str, $secret, true); - break; - case 'ACS3-HMAC-SM3': - $result = self::hmac_sm3($str, $secret, true); - break; - case 'ACS3-RSA-SHA256': - $privateKey = "-----BEGIN RSA PRIVATE KEY-----\n" . $secret . "\n-----END RSA PRIVATE KEY-----"; - @openssl_sign($str, $result, $privateKey, OPENSSL_ALGO_SHA256); - } - - return Utils::toBytes($result); - } - - /** - * Get encoded path. - * - * @param string $path the raw path - * - * @return string encoded path - */ - public static function getEncodePath($path) - { - $tmp = explode('/', $path); - foreach ($tmp as &$t) { - $t = rawurlencode($t); - } - - return implode('/', $tmp); - } - - /** - * Get encoded param. - * - * @param string $param the raw param - * - * @return string encoded param - */ - public static function getEncodeParam($param) - { - return rawurlencode($param); - } - - private static function getRpcStrToSign($method, $query) - { - ksort($query); - - $params = []; - foreach ($query as $k => $v) { - if (null !== $v) { - $k = rawurlencode($k); - $v = rawurlencode($v); - $params[] = $k . '=' . (string)$v; - } - } - $str = implode('&', $params); - - return $method . '&' . rawurlencode('/') . '&' . rawurlencode($str); - } - - private static function encode($signMethod, $strToSign, $secret) - { - switch ($signMethod) { - case 'HMAC-SHA256': - return base64_encode(hash_hmac('sha256', $strToSign, $secret, true)); - - default: - return base64_encode(hash_hmac('sha1', $strToSign, $secret, true)); - } - } - - /** - * @param array $items - * @param string $delimiter - * @param string $prepend - * - * @return array - */ - private static function flatten($items = [], $delimiter = '.', $prepend = '') - { - $flatten = []; - - foreach ($items as $key => $value) { - $pos = \is_int($key) ? $key + 1 : $key; - if (\is_array($value) && !empty($value)) { - $flatten = array_merge( - $flatten, - self::flatten($value, $delimiter, $prepend . $pos . $delimiter) - ); - } else { - $flatten[$prepend . $pos] = $value; - } - } - - return $flatten; - } - - private static function getCanonicalizedHeaders($headers, $prefix = 'x-acs-') - { - ksort($headers); - $str = ''; - foreach ($headers as $k => $v) { - if (0 === strpos(strtolower($k), $prefix)) { - $str .= $k . ':' . trim(self::filter($v)) . "\n"; - } - } - - return $str; - } - - private static function getCanonicalizedResource($pathname, $query) - { - if (0 === \count($query)) { - return $pathname; - } - ksort($query); - $tmp = []; - foreach ($query as $k => $v) { - if (!empty($v)) { - $tmp[] = $k . '=' . $v; - } else { - $tmp[] = $k; - } - } - - return $pathname . '?' . implode('&', $tmp); - } - - private static function parse($input, &$output) - { - if (null === $input || '' === $input) { - $output = []; - } - $recursive = function ($input) use (&$recursive) { - if ($input instanceof Model) { - $input = $input->toMap(); - } elseif (\is_object($input)) { - $input = get_object_vars($input); - } - if (!\is_array($input)) { - return $input; - } - $data = []; - foreach ($input as $k => $v) { - $data[$k] = $recursive($v); - } - - return $data; - }; - $output = $recursive($input); - if (!\is_array($output)) { - $output = [$output]; - } - } - - private static function filter($str) - { - return str_replace(["\t", "\n", "\r", "\f"], '', $str); - } - - private static function hmac_sm3($data, $key, $raw_output = false) - { - $pack = 'H' . \strlen(self::sm3('test')); - $blocksize = 64; - if (\strlen($key) > $blocksize) { - $key = pack($pack, self::sm3($key)); - } - $key = str_pad($key, $blocksize, \chr(0x00)); - $ipad = $key ^ str_repeat(\chr(0x36), $blocksize); - $opad = $key ^ str_repeat(\chr(0x5C), $blocksize); - $hmac = self::sm3($opad . pack($pack, self::sm3($ipad . $data))); - - return $raw_output ? pack($pack, $hmac) : $hmac; - } - - private static function sm3($message) - { - return (new Sm3())->sign($message); - } - - private static function getCanonicalQueryString($query) - { - ksort($query); - - $params = []; - foreach ($query as $k => $v) { - if (null === $v) { - continue; - } - $str = rawurlencode($k); - if ('' !== $v && null !== $v) { - $str .= '=' . rawurlencode($v); - } else { - $str .= '='; - } - $params[] = $str; - } - - return implode('&', $params); - } -} diff --git a/vendor/alibabacloud/openapi-util/tests/OpenApiUtilClientTest.php b/vendor/alibabacloud/openapi-util/tests/OpenApiUtilClientTest.php deleted file mode 100644 index b8b7f38..0000000 --- a/vendor/alibabacloud/openapi-util/tests/OpenApiUtilClientTest.php +++ /dev/null @@ -1,359 +0,0 @@ -a = 'foo'; - - $output = new MockModel(); - OpenApiUtilClient::convert($model, $output); - $this->assertEquals($model->a, $output->a); - } - - public function testGetStringToSign() - { - $request = new Request(); - $request->method = 'GET'; - $request->pathname = '/'; - $request->headers['accept'] = 'application/json'; - - $this->assertEquals("GET\napplication/json\n\n\n\n/", OpenApiUtilClient::getStringToSign($request)); - - $request->headers = [ - 'accept' => 'application/json', - 'content-md5' => 'md5', - 'content-type' => 'application/json', - 'date' => 'date', - ]; - $this->assertEquals("GET\napplication/json\nmd5\napplication/json\ndate\n/", OpenApiUtilClient::getStringToSign($request)); - - $request->headers = [ - 'accept' => 'application/json', - 'content-md5' => 'md5', - 'content-type' => 'application/json', - 'date' => 'date', - 'x-acs-custom-key' => 'any value', - ]; - $this->assertEquals("GET\napplication/json\nmd5\napplication/json\ndate\nx-acs-custom-key:any value\n/", OpenApiUtilClient::getStringToSign($request)); - - $request->query = [ - 'key' => 'val ue with space', - ]; - $this->assertEquals("GET\napplication/json\nmd5\napplication/json\ndate\nx-acs-custom-key:any value\n/?key=val ue with space", OpenApiUtilClient::getStringToSign($request)); - } - - public function testGetROASignature() - { - $this->assertEquals('OmuTAr79tpI6CRoAdmzKRq5lHs0=', OpenApiUtilClient::getROASignature('stringtosign', 'secret')); - } - - public function testToForm() - { - $this->assertEquals('client=test&strs.1=str1&strs.2=str2&tag.key=value', OpenApiUtilClient::toForm([ - 'client' => 'test', - 'tag' => [ - 'key' => 'value', - ], - 'strs' => ['str1', 'str2'], - ])); - } - - public function testGetTimestamp() - { - $date = OpenApiUtilClient::getTimestamp(); - $this->assertEquals(20, \strlen($date)); - } - - public function testQuery() - { - $array = [ - 'a' => 'a', - 'b1' => [ - 'a' => 'a', - ], - 'b2' => [ - 'a' => 'a', - ], - 'c' => ['x', 'y', 'z'], - ]; - $this->assertEquals([ - 'a' => 'a', - 'b1.a' => 'a', - 'b2.a' => 'a', - 'c.1' => 'x', - 'c.2' => 'y', - 'c.3' => 'z', - ], OpenApiUtilClient::query($array)); - } - - public function testGetRPCSignature() - { - $request = new Request(); - $request->pathname = ''; - $request->query = [ - 'query' => 'test', - 'body' => 'test', - ]; - $this->assertEquals('XlUyV4sXjOuX5FnjUz9IF9tm5rU=', OpenApiUtilClient::getRPCSignature($request->query, $request->method, 'secret')); - } - - public function testArrayToStringWithSpecifiedStyle() - { - $data = ['ok', 'test', 2, 3]; - $this->assertEquals( - 'instance.1=ok&instance.2=test&instance.3=2&instance.4=3', - OpenApiUtilClient::arrayToStringWithSpecifiedStyle( - $data, - 'instance', - 'repeatList' - ) - ); - - $this->assertEquals( - '["ok","test",2,3]', - OpenApiUtilClient::arrayToStringWithSpecifiedStyle( - $data, - 'instance', - 'json' - ) - ); - - $this->assertEquals( - 'ok,test,2,3', - OpenApiUtilClient::arrayToStringWithSpecifiedStyle( - $data, - 'instance', - 'simple' - ) - ); - - $this->assertEquals( - 'ok test 2 3', - OpenApiUtilClient::arrayToStringWithSpecifiedStyle( - $data, - 'instance', - 'spaceDelimited' - ) - ); - - $this->assertEquals( - 'ok|test|2|3', - OpenApiUtilClient::arrayToStringWithSpecifiedStyle( - $data, - 'instance', - 'pipeDelimited' - ) - ); - - $this->assertEquals( - '', - OpenApiUtilClient::arrayToStringWithSpecifiedStyle( - $data, - 'instance', - 'piDelimited' - ) - ); - - $this->assertEquals( - '', - OpenApiUtilClient::arrayToStringWithSpecifiedStyle( - null, - 'instance', - 'pipeDelimited' - ) - ); - } - - public function testParseToArray() - { - $test = $this->parseData(); - $data = $test['data']; - $expected = $test['expected']; - foreach ($data as $index => $item) { - $this->assertEquals($expected[$index], OpenApiUtilClient::parseToArray($item)); - } - } - - public function testParseToMap() - { - $test = $this->parseData(); - $data = $test['data']; - $expected = $test['expected']; - foreach ($data as $index => $item) { - $this->assertEquals($expected[$index], OpenApiUtilClient::parseToMap($item)); - } - } - - public function testGetEndpoint() - { - $endpoint = 'ecs.cn-hangzhou.aliyun.cs.com'; - $useAccelerate = false; - $endpointType = 'public'; - - $this->assertEquals('ecs.cn-hangzhou.aliyun.cs.com', OpenApiUtilClient::getEndpoint($endpoint, $useAccelerate, $endpointType)); - - $endpointType = 'internal'; - $this->assertEquals('ecs-internal.cn-hangzhou.aliyun.cs.com', OpenApiUtilClient::getEndpoint($endpoint, $useAccelerate, $endpointType)); - - $useAccelerate = true; - $endpointType = 'accelerate'; - $this->assertEquals('oss-accelerate.aliyuncs.com', OpenApiUtilClient::getEndpoint($endpoint, $useAccelerate, $endpointType)); - } - - public function testHexEncode() - { - $data = OpenApiUtilClient::hash(Utils::toBytes('test'), 'ACS3-HMAC-SHA256'); - $this->assertEquals( - Utils::toBytes(hex2bin('9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08')), - $data - ); - - $data = OpenApiUtilClient::hash(Utils::toBytes('test'), 'ACS3-RSA-SHA256'); - $this->assertEquals( - Utils::toBytes(hex2bin('9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08')), - $data - ); - - $data = OpenApiUtilClient::hash(Utils::toBytes('test'), 'ACS3-HMAC-SM3'); - $this->assertEquals( - Utils::toBytes(hex2bin('55e12e91650d2fec56ec74e1d3e4ddbfce2ef3a65890c2a19ecf88a307e76a23')), - $data - ); - - $data = OpenApiUtilClient::hash(Utils::toBytes('test'), 'ACS3-HM-SHA256'); - $this->assertEquals('', Utils::toString($data)); - } - - public function testGetEncodePath() - { - $this->assertEquals( - '/path/%20test', - OpenApiUtilClient::getEncodePath('/path/ test') - ); - } - - public function testGetEncodeParam() - { - $this->assertEquals( - 'a%2Fb%2Fc%2F%20test', - OpenApiUtilClient::getEncodeParam('a/b/c/ test') - ); - } - - public function testGetAuthorization() - { - $request = new Request(); - $request->method = ''; - $request->pathname = ''; - $request->query = [ - 'test' => 'ok', - 'empty' => '', - ]; - $request->headers = [ - 'x-acs-test' => 'http', - 'x-acs-TEST' => 'https', - ]; - - $res = OpenApiUtilClient::getAuthorization($request, 'ACS3-HMAC-SHA256', '55e12e91650d2fec56ec74e1d3e4ddbfce2ef3a65890c2a19ecf88a307e76a23', 'acesskey', 'secret'); - - $this->assertEquals('ACS3-HMAC-SHA256 Credential=acesskey,SignedHeaders=x-acs-test,Signature=0a0f89a45f1ec3537a2d1a1046c71b95513a8f1f02526056968da19b99a5b914', $res); - } - - public function testSign() - { - $this->assertEquals( - 'b9ff646822f41ef647c1416fa2b8408923828abc0464af6706e18db3e8553da8', - OpenApiUtilClient::hexEncode(OpenApiUtilClient::sign('secret', 'source', 'ACS3-HMAC-SM3')) - ); - $this->assertEquals('1d93c62698a1c26427265668e79fac099aa26c1df873669599a2fb2f272e64c9', - OpenApiUtilClient::hexEncode(OpenApiUtilClient::sign('secret', 'source', 'ACS3-HMAC-SHA256')) - ); - } - - private function parseData() - { - return [ - 'data' => [ - 'NotArray', - new ParseModel([ - 'str' => 'A', - 'model' => new ParseModel(['str' => 'sub model']), - 'array' => [1, 2, 3], - ]), - [ // model item in array - new ParseModel([ - 'str' => 'A', - ]), - ], - [ // model item in map - 'model' => new ParseModel([ - 'str' => 'A', - ]), - ], - ], - 'expected' => [ - ['NotArray'], - [ - 'str' => 'A', - 'model' => [ - 'str' => 'sub model', - 'model' => null, - 'array' => null, - ], - 'array' => [1, 2, 3], - ], - [ - [ - 'str' => 'A', - 'model' => null, - 'array' => null, - ], - ], - [ - 'model' => [ - 'str' => 'A', - 'model' => null, - 'array' => null, - ], - ], - ], - ]; - } -} - -class MockModel extends Model -{ - public $a = 'A'; - - public $b = ''; - - public $c = ''; - - public function __construct() - { - $this->_name['a'] = 'A'; - $this->_required['c'] = true; - parent::__construct([]); - } -} - -class ParseModel extends Model -{ - public $str; - public $model; - public $array; -} diff --git a/vendor/alibabacloud/openapi-util/tests/bootstrap.php b/vendor/alibabacloud/openapi-util/tests/bootstrap.php deleted file mode 100644 index c62c4e8..0000000 --- a/vendor/alibabacloud/openapi-util/tests/bootstrap.php +++ /dev/null @@ -1,3 +0,0 @@ -setRiskyAllowed(true) - ->setIndent(' ') - ->setRules([ - '@PSR2' => true, - '@PhpCsFixer' => true, - '@Symfony:risky' => true, - 'concat_space' => ['spacing' => 'one'], - 'array_syntax' => ['syntax' => 'short'], - 'array_indentation' => true, - 'combine_consecutive_unsets' => true, - 'method_separation' => true, - 'single_quote' => true, - 'declare_equal_normalize' => true, - 'function_typehint_space' => true, - 'hash_to_slash_comment' => true, - 'include' => true, - 'lowercase_cast' => true, - 'no_multiline_whitespace_before_semicolons' => true, - 'no_leading_import_slash' => true, - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_spaces_around_offset' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unused_imports' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'object_operator_without_whitespace' => true, - 'single_blank_line_before_namespace' => true, - 'single_class_element_per_statement' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'whitespace_after_comma_in_array' => true, - 'no_extra_consecutive_blank_lines' => [ - 'curly_brace_block', - 'extra', - 'parenthesis_brace_block', - 'square_brace_block', - 'throw', - 'use', - ], - 'binary_operator_spaces' => [ - 'align_double_arrow' => true, - 'align_equals' => true, - ], - 'braces' => [ - 'allow_single_line_closure' => true, - ], - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude('vendor') - ->exclude('tests') - ->in(__DIR__) - ); diff --git a/vendor/alibabacloud/tea-utils/README-CN.md b/vendor/alibabacloud/tea-utils/README-CN.md deleted file mode 100644 index 07553ca..0000000 --- a/vendor/alibabacloud/tea-utils/README-CN.md +++ /dev/null @@ -1,31 +0,0 @@ -English | [简体中文](README-CN.md) - -![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg) - -## Alibaba Cloud Tea Util for PHP - -## Installation - -### Composer - -```bash -composer require alibabacloud/tea-utils -``` - -## Issues - -[Opening an Issue](https://github.com/aliyun/tea-util/issues/new), Issues not conforming to the guidelines may be closed immediately. - -## Changelog - -Detailed changes for each release are documented in the [release notes](./ChangeLog.txt). - -## References - -* [Latest Release](https://github.com/aliyun/tea-util) - -## License - -[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) - -Copyright (c) 2009-present, Alibaba Cloud All rights reserved. diff --git a/vendor/alibabacloud/tea-utils/README.md b/vendor/alibabacloud/tea-utils/README.md deleted file mode 100644 index ef53f6e..0000000 --- a/vendor/alibabacloud/tea-utils/README.md +++ /dev/null @@ -1,31 +0,0 @@ -[English](README.md) | 简体中文 - -![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg) - -## Alibaba Cloud Tea Util for PHP - -## 安装 - -### Composer - -```bash -composer require alibabacloud/tea-utils -``` - -## 问题 - -[提交 Issue](https://github.com/aliyun/tea-util/issues/new),不符合指南的问题可能会立即关闭。 - -## 发行说明 - -每个版本的详细更改记录在[发行说明](./ChangeLog.txt)中。 - -## 相关 - -* [最新源码](https://github.com/aliyun/tea-util) - -## 许可证 - -[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) - -Copyright (c) 2009-present, Alibaba Cloud All rights reserved. diff --git a/vendor/alibabacloud/tea-utils/composer.json b/vendor/alibabacloud/tea-utils/composer.json deleted file mode 100644 index f1178c0..0000000 --- a/vendor/alibabacloud/tea-utils/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "alibabacloud/tea-utils", - "description": "Alibaba Cloud Tea Utils for PHP", - "type": "library", - "license": "Apache-2.0", - "authors": [ - { - "name": "Alibaba Cloud SDK", - "email": "sdk-team@alibabacloud.com" - } - ], - "support": { - "source": "https://github.com/aliyun/tea-util", - "issues": "https://github.com/aliyun/tea-util/issues" - }, - "require": { - "php": ">5.5", - "alibabacloud/tea": "^3.1" - }, - "autoload": { - "psr-4": { - "AlibabaCloud\\Tea\\Utils\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "AlibabaCloud\\Tea\\Utils\\Tests\\": "tests" - } - }, - "scripts": { - "fixer": "php-cs-fixer fix ./", - "test": [ - "@clearCache", - "./vendor/bin/phpunit --colors=always" - ], - "clearCache": "rm -rf cache/*" - } -} diff --git a/vendor/alibabacloud/tea-utils/phpunit.xml b/vendor/alibabacloud/tea-utils/phpunit.xml deleted file mode 100644 index ce66fc8..0000000 --- a/vendor/alibabacloud/tea-utils/phpunit.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - tests - - - diff --git a/vendor/alibabacloud/tea-utils/src/Utils.php b/vendor/alibabacloud/tea-utils/src/Utils.php deleted file mode 100644 index c19df44..0000000 --- a/vendor/alibabacloud/tea-utils/src/Utils.php +++ /dev/null @@ -1,560 +0,0 @@ -isSeekable()) { - $stream->rewind(); - } - - return $stream->getContents(); - } - - /** - * Read data from a readable stream, and parse it by JSON format. - * - * @param StreamInterface $stream the readable stream - * - * @return array the parsed result - */ - public static function readAsJSON($stream) - { - return self::parseJSON(self::readAsString($stream)); - } - - /** - * Generate a nonce string. - * - * @return string the nonce string - */ - public static function getNonce() - { - return md5(uniqid() . uniqid(md5(microtime(true)), true)); - } - - /** - * Get an UTC format string by current date, e.g. 'Thu, 06 Feb 2020 07:32:54 GMT'. - * - * @return string the UTC format string - */ - public static function getDateUTCString() - { - return gmdate('D, d M Y H:i:s T'); - } - - /** - * If not set the real, use default value. - * - * @param string $real - * @param string $default - * - * @return string - */ - public static function defaultString($real, $default = '') - { - return null === $real ? $default : $real; - } - - /** - * If not set the real, use default value. - * - * @param int $real - * @param int $default - * - * @return int the return number - */ - public static function defaultNumber($real, $default = 0) - { - if (null === $real) { - return $default; - } - - return (int) $real; - } - - /** - * Format a map to form string, like a=a%20b%20c. - * - * @param array|object $query - * - * @return string the form string - */ - public static function toFormString($query) - { - if (null === $query) { - return ''; - } - - if (\is_object($query)) { - $query = json_decode(self::toJSONString($query), true); - } - - return str_replace('+', '%20', http_build_query($query)); - } - - /** - * If not set the real, use default value. - * - * @param array|Model $object - * - * @return string the return string - */ - public static function toJSONString($object) - { - if (null === $object) { - $object = new \stdClass(); - } - - if ($object instanceof Model) { - $object = $object->toMap(); - } - - return json_encode($object); - } - - /** - * Check the string is empty? - * - * @param string $val - * - * @return bool if string is null or zero length, return true - * - * @deprecated - */ - public static function _empty($val) - { - return empty($val); - } - - /** - * Check the string is empty? - * - * @param string $val - * - * @return bool if string is null or zero length, return true - * - * @deprecated - */ - public static function emptyWithSuffix($val) - { - return empty($val); - } - - /** - * Check the string is empty? - * - * @param string $val - * - * @return bool if string is null or zero length, return true - */ - public static function empty_($val) - { - return empty($val); - } - - /** - * Check one string equals another one? - * - * @param int $left - * @param int $right - * - * @return bool if equals, return true - */ - public static function equalString($left, $right) - { - return $left === $right; - } - - /** - * Check one number equals another one? - * - * @param int $left - * @param int $right - * - * @return bool if equals, return true - */ - public static function equalNumber($left, $right) - { - return $left === $right; - } - - /** - * Check one value is unset. - * - * @param mixed $value - * - * @return bool if unset, return true - */ - public static function isUnset(&$value = null) - { - return !isset($value) || null === $value; - } - - /** - * Stringify the value of map. - * - * @param array $map - * - * @return array the new stringified map - */ - public static function stringifyMapValue($map) - { - if (null === $map) { - return []; - } - foreach ($map as &$node) { - if (is_numeric($node)) { - $node = (string) $node; - } elseif (null === $node) { - $node = ''; - } elseif (\is_bool($node)) { - $node = true === $node ? 'true' : 'false'; - } elseif (\is_object($node)) { - $node = json_decode(json_encode($node), true); - } - } - - return $map; - } - - /** - * Anyify the value of map. - * - * @param array $m - * - * @return array the new anyfied map - */ - public static function anyifyMapValue($m) - { - return $m; - } - - /** - * Assert a value, if it is a boolean, return it, otherwise throws. - * - * @param mixed $value - * - * @return bool the boolean value - */ - public static function assertAsBoolean($value) - { - return \is_bool($value); - } - - /** - * Assert a value, if it is a string, return it, otherwise throws. - * - * @param mixed $value - * - * @return bool the string value - */ - public static function assertAsString($value) - { - return \is_string($value); - } - - /** - * Assert a value, if it is a bytes, return it, otherwise throws. - * - * @param mixed $value - * - * @return bool the bytes value - */ - public static function assertAsBytes($value) - { - if (!\is_array($value)) { - return false; - } - $i = 0; - foreach ($value as $k => $ord) { - if ($k !== $i) { - return false; - } - if (!\is_int($ord)) { - return false; - } - if ($ord < 0 || $ord > 255) { - return false; - } - ++$i; - } - - return true; - } - - /** - * Assert a value, if it is a number, return it, otherwise throws. - * - * @param mixed $value - * - * @return bool the number value - */ - public static function assertAsNumber($value) - { - return is_numeric($value); - } - - /** - * Assert a value, if it is a map, return it, otherwise throws. - * - * @param $any - * - * @return array the map value - */ - public static function assertAsMap($any) - { - if (\is_array($any)) { - return $any; - } - - throw new \InvalidArgumentException('It is not a map value.'); - } - - public static function assertAsArray($any){ - if (\is_array($any)) { - return $any; - } - - throw new \InvalidArgumentException('It is not a array value.'); - } - - /** - * Get user agent, if it userAgent is not null, splice it with defaultUserAgent and return, otherwise return - * defaultUserAgent. - * - * @param string $userAgent - * - * @return string the string value - */ - public static function getUserAgent($userAgent = '') - { - if (empty(self::$defaultUserAgent)) { - self::$defaultUserAgent = sprintf('AlibabaCloud (%s; %s) PHP/%s Core/3.1 TeaDSL/1', PHP_OS, \PHP_SAPI, PHP_VERSION); - } - if (!empty($userAgent)) { - return self::$defaultUserAgent . ' ' . $userAgent; - } - - return self::$defaultUserAgent; - } - - /** - * If the code between 200 and 300, return true, or return false. - * - * @param int $code - * - * @return bool - */ - public static function is2xx($code) - { - return $code >= 200 && $code < 300; - } - - /** - * If the code between 300 and 400, return true, or return false. - * - * @param int $code - * - * @return bool - */ - public static function is3xx($code) - { - return $code >= 300 && $code < 400; - } - - /** - * If the code between 400 and 500, return true, or return false. - * - * @param int $code - * - * @return bool - */ - public static function is4xx($code) - { - return $code >= 400 && $code < 500; - } - - /** - * If the code between 500 and 600, return true, or return false. - * - * @param int $code - * - * @return bool - */ - public static function is5xx($code) - { - return $code >= 500 && $code < 600; - } - - /** - * Validate model. - * - * @param Model $model - */ - public static function validateModel($model) - { - if (null !== $model) { - $model->validate(); - } - } - - /** - * Model transforms to map[string]any. - * - * @param Model $model - * - * @return array - */ - public static function toMap($model) - { - if (null === $model) { - return []; - } - $map = $model->toMap(); - $names = $model->getName(); - $vars = get_object_vars($model); - foreach ($vars as $k => $v) { - if (false !== strpos($k, 'Shrink') && !isset($names[$k])) { - // A field that has the suffix `Shrink` and is not a Model class property. - $targetKey = ucfirst(substr($k, 0, \strlen($k) - 6)); - if (isset($map[$targetKey])) { - // $targetKey exists in $map. - $map[$targetKey] = $v; - } - } - } - - return $map; - } - - /** - * Suspends the current thread for the specified number of milliseconds. - * - * @param int $millisecond - */ - public static function sleep($millisecond) - { - usleep($millisecond * 1000); - } - - /** - * Transform input as array. - * - * @param mixed $input - * - * @return array - */ - public static function toArray($input) - { - if (\is_array($input)) { - foreach ($input as $k => &$v) { - $v = self::toArray($v); - } - } elseif ($input instanceof Model) { - $input = $input->toMap(); - foreach ($input as $k => &$v) { - $v = self::toArray($v); - } - } - - return $input; - } - - /** - * Assert a value, if it is a readable, return it, otherwise throws. - * - * @param mixed $value - * - * @return Stream the readable value - */ - public static function assertAsReadable($value) - { - if (\is_string($value)) { - return new Stream( - fopen('data://text/plain;base64,' . - base64_encode($value), 'r') - ); - } - if ($value instanceof Stream) { - return $value; - } - - throw new \InvalidArgumentException('It is not a stream value.'); - } -} diff --git a/vendor/alibabacloud/tea-utils/src/Utils/RuntimeOptions.php b/vendor/alibabacloud/tea-utils/src/Utils/RuntimeOptions.php deleted file mode 100644 index 3d643ed..0000000 --- a/vendor/alibabacloud/tea-utils/src/Utils/RuntimeOptions.php +++ /dev/null @@ -1,39 +0,0 @@ -assertEquals([ - 115, 116, 114, 105, 110, 103, - ], Utils::toBytes('string')); - } - - public function testToString() - { - $this->assertEquals('string', Utils::toString([ - 115, 116, 114, 105, 110, 103, - ])); - } - - public function testParseJSON() - { - $this->assertEquals([ - 'a' => 'b', - ], Utils::parseJSON('{"a":"b"}')); - } - - public function testReadAsBytes() - { - $bytes = Utils::readAsBytes($this->getStream()); - $this->assertEquals(123, $bytes[0]); - } - - public function testReadAsString() - { - $string = Utils::readAsString($this->getStream()); - $this->assertEquals($string[0], '{'); - } - - public function testReadAsJSON() - { - $result = Utils::readAsJSON($this->getStream()); - $this->assertEquals('http://httpbin.org/get', $result['url']); - } - - public function testGetNonce() - { - $nonce1 = Utils::getNonce(); - $nonce2 = Utils::getNonce(); - - $this->assertNotEquals($nonce1, $nonce2); - } - - public function testGetDateUTCString() - { - $gmdate = Utils::getDateUTCString(); - $now = time(); - $this->assertTrue(abs($now - strtotime($gmdate)) <= 1); - } - - public function testDefaultString() - { - $this->assertEquals('', Utils::defaultString(null)); - $this->assertEquals('default', Utils::defaultString(null, 'default')); - $this->assertEquals('real', Utils::defaultString('real', 'default')); - } - - public function testDefaultNumber() - { - $this->assertEquals(0, Utils::defaultNumber(null)); - $this->assertEquals(0, Utils::defaultNumber(0, 3)); - $this->assertEquals(404, Utils::defaultNumber(null, 404)); - $this->assertEquals(200, Utils::defaultNumber(200, 404)); - } - - public function testToFormString() - { - $query = [ - 'foo' => 'bar', - 'empty' => '', - 'a' => null, - 'withWhiteSpace' => 'a b', - ]; - $this->assertEquals('foo=bar&empty=&withWhiteSpace=a%20b', Utils::toFormString($query)); - - $object = json_decode(json_encode($query)); - $this->assertEquals('foo=bar&empty=&withWhiteSpace=a%20b', Utils::toFormString($object)); - } - - public function testToJSONString() - { - $object = new \stdClass(); - $this->assertJson(Utils::toJSONString($object)); - } - - public function testEmpty() - { - $this->assertTrue(Utils::_empty('')); - $this->assertFalse(Utils::_empty('not empty')); - } - - public function testEqualString() - { - $this->assertTrue(Utils::equalString('a', 'a')); - $this->assertFalse(Utils::equalString('a', 'b')); - } - - public function testEqualNumber() - { - $this->assertTrue(Utils::equalNumber(1, 1)); - $this->assertFalse(Utils::equalNumber(1, 2)); - } - - public function testIsUnset() - { - $this->assertTrue(Utils::isUnset($a)); - $b = 1; - $this->assertFalse(Utils::isUnset($b)); - } - - public function testStringifyMapValue() - { - $this->assertEquals([], Utils::stringifyMapValue(null)); - $this->assertEquals([ - 'foo' => 'bar', - 'null' => '', - 'true' => 'true', - 'false' => 'false', - 'number' => '1000', - ], Utils::stringifyMapValue([ - 'foo' => 'bar', - 'null' => null, - 'true' => true, - 'false' => false, - 'number' => 1000, - ])); - } - - public function testAnyifyMapValue() - { - $this->assertEquals([ - 'foo' => 'bar', - 'null' => null, - 'true' => true, - 'false' => false, - 'number' => 1000, - ], Utils::anyifyMapValue([ - 'foo' => 'bar', - 'null' => null, - 'true' => true, - 'false' => false, - 'number' => 1000, - ])); - } - - public function testAssertAsBoolean() - { - $this->assertTrue(Utils::assertAsBoolean(true)); - $this->assertFalse(Utils::assertAsBoolean('true')); - } - - public function testAssertAsString() - { - $this->assertTrue(Utils::assertAsString('123')); - $this->assertFalse(Utils::assertAsString(123)); - } - - public function testAssertAsBytes() - { - // failed because $var is not array - $this->assertFalse(Utils::assertAsBytes('test')); - - // failed because $var is map not array - $this->assertFalse(Utils::assertAsBytes(['foo' => 1])); - - // failed because item value is not int - $this->assertFalse(Utils::assertAsBytes(['1'])); - - // failed because item value is out off range - $this->assertFalse(Utils::assertAsBytes([256])); - - // success - $this->assertTrue(Utils::assertAsBytes([1, 2, 3])); - $this->assertTrue(Utils::assertAsBytes(Utils::toBytes('string'))); - } - - public function testAssertAsNumber() - { - $this->assertTrue(Utils::assertAsNumber(123)); - $this->assertFalse(Utils::assertAsNumber('string')); - } - - public function testAssertAsMap() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('It is not a map value.'); - Utils::assertAsMap('is not array'); - - try { - $map = ['foo' => 'bar']; - $this->assertEquals($map, Utils::assertAsMap($map)); - } catch (\Exception $e) { - // should not be here - $this->assertTrue(false); - } - } - - public function testAssertAsArray() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('It is not a array value.'); - Utils::assertAsArray('is not array'); - - try { - $map = ['foo']; - $this->assertEquals($map, Utils::assertAsArray($map)); - } catch (\Exception $e) { - // should not be here - $this->assertTrue(false); - } - } - - public function testGetUserAgent() - { - $this->assertTrue(false !== strpos(Utils::getUserAgent('CustomUserAgent'), 'CustomUserAgent')); - } - - public function testIs2xx() - { - $this->assertTrue(Utils::is2xx(200)); - $this->assertFalse(Utils::is2xx(300)); - } - - public function testIs3xx() - { - $this->assertTrue(Utils::is3xx(300)); - $this->assertFalse(Utils::is3xx(400)); - } - - public function testIs4xx() - { - $this->assertTrue(Utils::is4xx(400)); - $this->assertFalse(Utils::is4xx(500)); - } - - public function testIs5xx() - { - $this->assertTrue(Utils::is5xx(500)); - $this->assertFalse(Utils::is5xx(600)); - } - - public function testToMap() - { - $from = new RequestTest(); - $from->query = new RequestTestQuery([ - 'booleanParamInQuery' => true, - 'mapParamInQuery' => [1, 2, 3], - ]); - $this->assertTrue($from->query->booleanParamInQuery); - $this->assertEquals([1, 2, 3], $from->query->mapParamInQuery); - - $target = new RequestShrinkTest([]); - $this->convert($from, $target); - $this->assertEquals([ - 'BooleanParamInQuery' => true, - 'MapParamInQuery' => [1, 2, 3], - ], $target->query->toMap()); - - $target->query->mapParamInQueryShrink = json_encode($from->query->mapParamInQuery); - $this->assertEquals([ - 'BooleanParamInQuery' => true, - 'MapParamInQuery' => '[1,2,3]', - ], Utils::toMap($target->query)); - } - - public function testSleep() - { - $before = microtime(true) * 1000; - Utils::sleep(1000); - $after = microtime(true) * 1000; - $sub = $after - $before; - $this->assertTrue(990 <= $sub && $sub <= 1100); - } - - public function testToArray() - { - $model = new RequestTest(); - $model->query = 'foo'; - $this->assertEquals([ - ['query' => 'foo'], - ], Utils::toArray([$model])); - - $subModel = new RequestTest(); - $subModel->query = 'bar'; - $model->query = $subModel; - $this->assertEquals([ - ['query' => ['query' => 'bar']], - ], Utils::toArray([$model])); - } - - public function testAssertAsReadable() - { - $s0 = Utils::assertAsReadable('string content'); - $this->assertTrue($s0 instanceof Stream); - - $s1 = Utils::assertAsReadable($s0); - $this->assertEquals($s1, $s0); - - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('It is not a stream value.'); - Utils::assertAsReadable(0); - } - - private function convert($body, &$content) - { - $class = new \ReflectionClass($body); - foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) { - $name = $property->getName(); - if (!$property->isStatic()) { - $value = $property->getValue($body); - if ($value instanceof StreamInterface) { - continue; - } - $content->{$name} = $value; - } - } - } -} - -/** - * @internal - * @coversNothing - */ -class RequestTest extends Model -{ - /** - * @var RequestTestQuery - */ - public $query; -} - -/** - * @internal - * @coversNothing - */ -class RequestShrinkTest extends Model -{ - /** - * @var RequestTestShrinkQuery - */ - public $query; -} - -class RequestTestQuery extends Model -{ - /** - * @description test - * - * @var bool - */ - public $booleanParamInQuery; - - /** - * @description test - * - * @var array - */ - public $mapParamInQuery; - protected $_name = [ - 'booleanParamInQuery' => 'BooleanParamInQuery', - 'mapParamInQuery' => 'MapParamInQuery', - ]; - - public function toMap() - { - $res = []; - if (null !== $this->booleanParamInQuery) { - $res['BooleanParamInQuery'] = $this->booleanParamInQuery; - } - if (null !== $this->mapParamInQuery) { - $res['MapParamInQuery'] = $this->mapParamInQuery; - } - - return $res; - } -} - -class RequestTestShrinkQuery extends Model -{ - /** - * @description test - * - * @var float - */ - public $booleanParamInQuery; - - /** - * @description test - * - * @var string - */ - public $mapParamInQueryShrink; - protected $_name = [ - 'booleanParamInQuery' => 'BooleanParamInQuery', - 'mapParamInQueryShrink' => 'MapParamInQuery', - ]; - - public function toMap() - { - $res = []; - if (null !== $this->booleanParamInQuery) { - $res['BooleanParamInQuery'] = $this->booleanParamInQuery; - } - if (null !== $this->mapParamInQueryShrink) { - $res['MapParamInQuery'] = $this->mapParamInQueryShrink; - } - - return $res; - } -} diff --git a/vendor/alibabacloud/tea-utils/tests/bootstrap.php b/vendor/alibabacloud/tea-utils/tests/bootstrap.php deleted file mode 100644 index c62c4e8..0000000 --- a/vendor/alibabacloud/tea-utils/tests/bootstrap.php +++ /dev/null @@ -1,3 +0,0 @@ -setRiskyAllowed(true) - ->setIndent(' ') - ->setRules([ - '@PSR2' => true, - '@PhpCsFixer' => true, - '@Symfony:risky' => true, - 'concat_space' => ['spacing' => 'one'], - 'array_syntax' => ['syntax' => 'short'], - 'array_indentation' => true, - 'combine_consecutive_unsets' => true, - 'method_separation' => true, - 'single_quote' => true, - 'declare_equal_normalize' => true, - 'function_typehint_space' => true, - 'hash_to_slash_comment' => true, - 'include' => true, - 'lowercase_cast' => true, - 'no_multiline_whitespace_before_semicolons' => true, - 'no_leading_import_slash' => true, - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_spaces_around_offset' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unused_imports' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'object_operator_without_whitespace' => true, - 'single_blank_line_before_namespace' => true, - 'single_class_element_per_statement' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'whitespace_after_comma_in_array' => true, - 'no_extra_consecutive_blank_lines' => [ - 'curly_brace_block', - 'extra', - 'parenthesis_brace_block', - 'square_brace_block', - 'throw', - 'use', - ], - 'binary_operator_spaces' => [ - 'align_double_arrow' => true, - 'align_equals' => true, - ], - 'braces' => [ - 'allow_single_line_closure' => true, - ], - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude('vendor') - ->exclude('tests') - ->in(__DIR__) - ); diff --git a/vendor/alibabacloud/tea/CHANGELOG.md b/vendor/alibabacloud/tea/CHANGELOG.md deleted file mode 100644 index a3b6a53..0000000 --- a/vendor/alibabacloud/tea/CHANGELOG.md +++ /dev/null @@ -1,148 +0,0 @@ -# CHANGELOG - -## 3.1.22 - 2021-05-11 - -- Deprecate `stream_for` method. - -## 3.1.21 - 2021-03-15 - -- Supported set proxy&timeout on request. - -## 3.1.20 - 2020-12-02 - -- Fix the warning when the Tea::merge method received empty arguments. - -## 3.1.19 - 2020-10-09 - -- Fix the error when the code value is a string. - -## 3.1.18 - 2020-09-28 - -- Require Guzzle Version 7.0 - -## 3.1.17 - 2020-09-24 - -- TeaUnableRetryError support get error info. - -## 3.1.16 - 2020-08-31 - -- Fix the Maximum function nesting level error when repeated network requests. - -## 3.1.15 - 2020-07-28 - -- Improved validatePattern method. - -## 3.1.14 - 2020-07-03 - -- Supported set properties of TeaError with `ErrorInfo`. - -## 3.1.13 - 2020-06-09 - -- Reduce dependencies. - -## 3.1.12 - 2020-05-13 - -- Add validate method. -- Supported validate maximun&minimun of property. - -## 3.1.11 - 2020-05-07 - -- Fixed error when class is undefined. - -## 3.1.10 - 2020-05-07 - -- Fixed error when '$item' of array is null - -## 3.1.9 - 2020-04-13 - -- TeaUnableRetryError add $lastException param. - -## 3.1.8 - 2020-04-02 - -- Added some static methods of Model to validate fields of Model. - -## 3.1.7 - 2020-03-27 - -- Improve Tea::isRetryable method. - -## 3.1.6 - 2020-03-25 - -- Fixed bug when body is StreamInterface. - -## 3.1.5 - 2020-03-25 - -- Improve Model.toMap method. -- Improve Tea.merge method. -- Fixed tests. - -## 3.1.4 - 2020-03-20 - -- Added Tea::merge method. -- Change Tea::isRetryable method. - -## 3.1.3 - 2020-03-20 - -- Model: added toModel method. - -## 3.1.2 - 2020-03-19 - -- Model constructor supported array type parameter. - -## 3.1.1 - 2020-03-18 - -- Fixed bug : set method failed. -- Fixed bug : get empty contents form body. - -## 3.1.0 - 2020-03-13 - -- TeaUnableRetryError add 'lastRequest' property. -- Change Tea.send() method return. -- Fixed Tea. allowRetry() method. - -## 3.0.0 - 2020-02-14 -- Rename package name. - -## 2.0.3 - 2020-02-14 -- Improved Exception. - -## 2.0.2 - 2019-09-11 -- Supported `String`. - -## 2.0.1 - 2019-08-15 -- Supported `IteratorAggregate`. - -## 2.0.0 - 2019-08-14 -- Design `Request` as a standard `PsrRequest`. - -## 1.0.10 - 2019-08-12 -- Added `__toString` for `Response`. - -## 1.0.9 - 2019-08-01 -- Updated `Middleware`. - -## 1.0.8 - 2019-07-29 -- Supported `TransferStats`. - -## 1.0.7 - 2019-07-27 -- Improved request. - -## 1.0.6 - 2019-07-23 -- Trim key for parameter. - -## 1.0.5 - 2019-07-23 -- Supported default protocol. - -## 1.0.4 - 2019-07-22 -- Added `toArray()`. - -## 1.0.3 - 2019-05-02 -- Improved `Request`. - -## 1.0.2 - 2019-05-02 -- Added getHeader/getHeaders. - -## 1.0.1 - 2019-04-02 -- Improved design. - -## 1.0.0 - 2019-05-02 -- Initial release of the AlibabaCloud Tea Version 1.0.0 on Packagist See for more information. diff --git a/vendor/alibabacloud/tea/LICENSE.md b/vendor/alibabacloud/tea/LICENSE.md deleted file mode 100644 index ec13fcc..0000000 --- a/vendor/alibabacloud/tea/LICENSE.md +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2009-present, Alibaba Cloud All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/vendor/alibabacloud/tea/README.md b/vendor/alibabacloud/tea/README.md deleted file mode 100644 index a8cbe66..0000000 --- a/vendor/alibabacloud/tea/README.md +++ /dev/null @@ -1,16 +0,0 @@ - -## Installation -``` -composer require alibabacloud/tea --optimize-autoloader -``` -> Some users may not be able to install due to network problems, you can try to switch the Composer mirror. - - -## Changelog -Detailed changes for each release are documented in the [release notes](CHANGELOG.md). - - -## License -[Apache-2.0](LICENSE.md) - -Copyright (c) 2009-present, Alibaba Cloud All rights reserved. diff --git a/vendor/alibabacloud/tea/composer.json b/vendor/alibabacloud/tea/composer.json deleted file mode 100644 index 87dd0bf..0000000 --- a/vendor/alibabacloud/tea/composer.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "name": "alibabacloud/tea", - "homepage": "https://www.alibabacloud.com/", - "description": "Client of Tea for PHP", - "keywords": [ - "tea", - "client", - "alibabacloud", - "cloud" - ], - "type": "library", - "license": "Apache-2.0", - "support": { - "source": "https://github.com/aliyun/tea-php", - "issues": "https://github.com/aliyun/tea-php/issues" - }, - "authors": [ - { - "name": "Alibaba Cloud SDK", - "email": "sdk-team@alibabacloud.com", - "homepage": "http://www.alibabacloud.com" - } - ], - "require": { - "php": ">=5.5", - "ext-curl": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-openssl": "*", - "ext-simplexml": "*", - "ext-xmlwriter": "*", - "guzzlehttp/guzzle": "^6.3|^7.0", - "adbario/php-dot-notation": "^2.2" - }, - "require-dev": { - "symfony/dotenv": "^3.4", - "phpunit/phpunit": "*", - "symfony/var-dumper": "^3.4" - }, - "suggest": { - "ext-sockets": "To use client-side monitoring" - }, - "autoload": { - "psr-4": { - "AlibabaCloud\\Tea\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "AlibabaCloud\\Tea\\Tests\\": "tests" - } - }, - "config": { - "sort-packages": true, - "preferred-install": "dist", - "optimize-autoloader": true - }, - "prefer-stable": true, - "minimum-stability": "dev", - "scripts": { - "cs": "phpcs --standard=PSR2 -n ./", - "cbf": "phpcbf --standard=PSR2 -n ./", - "fixer": "php-cs-fixer fix ./", - "test": [ - "@clearCache", - "phpunit --colors=always" - ], - "unit": [ - "@clearCache", - "phpunit --testsuite=Unit --colors=always" - ], - "feature": [ - "@clearCache", - "phpunit --testsuite=Feature --colors=always" - ], - "clearCache": "rm -rf cache/*", - "coverage": "open cache/coverage/index.html" - } -} diff --git a/vendor/alibabacloud/tea/src/Exception/TeaError.php b/vendor/alibabacloud/tea/src/Exception/TeaError.php deleted file mode 100644 index 3d8fb9c..0000000 --- a/vendor/alibabacloud/tea/src/Exception/TeaError.php +++ /dev/null @@ -1,47 +0,0 @@ -errorInfo = $errorInfo; - if (!empty($errorInfo)) { - $properties = ['name', 'message', 'code', 'data']; - foreach ($properties as $property) { - if (isset($errorInfo[$property])) { - $this->{$property} = $errorInfo[$property]; - } - } - } - } - - /** - * @return array - */ - public function getErrorInfo() - { - return $this->errorInfo; - } -} diff --git a/vendor/alibabacloud/tea/src/Exception/TeaRetryError.php b/vendor/alibabacloud/tea/src/Exception/TeaRetryError.php deleted file mode 100644 index 30aa7f8..0000000 --- a/vendor/alibabacloud/tea/src/Exception/TeaRetryError.php +++ /dev/null @@ -1,21 +0,0 @@ -getErrorInfo(); - } - parent::__construct($error_info, $lastException->getMessage(), $lastException->getCode(), $lastException); - $this->lastRequest = $lastRequest; - $this->lastException = $lastException; - } - - public function getLastRequest() - { - return $this->lastRequest; - } - - public function getLastException() - { - return $this->lastException; - } -} diff --git a/vendor/alibabacloud/tea/src/Helper.php b/vendor/alibabacloud/tea/src/Helper.php deleted file mode 100644 index c9efd97..0000000 --- a/vendor/alibabacloud/tea/src/Helper.php +++ /dev/null @@ -1,68 +0,0 @@ - $value) { - if (\is_int($key)) { - $result[] = $value; - - continue; - } - - if (isset($result[$key]) && \is_array($result[$key])) { - $result[$key] = self::merge( - [$result[$key], $value] - ); - - continue; - } - - $result[$key] = $value; - } - } - - return $result; - } -} diff --git a/vendor/alibabacloud/tea/src/Model.php b/vendor/alibabacloud/tea/src/Model.php deleted file mode 100644 index 538b55c..0000000 --- a/vendor/alibabacloud/tea/src/Model.php +++ /dev/null @@ -1,114 +0,0 @@ - $v) { - $this->{$k} = $v; - } - } - } - - public function getName($name = null) - { - if (null === $name) { - return $this->_name; - } - - return isset($this->_name[$name]) ? $this->_name[$name] : $name; - } - - public function toMap() - { - $map = get_object_vars($this); - foreach ($map as $k => $m) { - if (0 === strpos($k, '_')) { - unset($map[$k]); - } - } - $res = []; - foreach ($map as $k => $v) { - $name = isset($this->_name[$k]) ? $this->_name[$k] : $k; - $res[$name] = $v; - } - - return $res; - } - - public function validate() - { - $vars = get_object_vars($this); - foreach ($vars as $k => $v) { - if (isset($this->_required[$k]) && $this->_required[$k] && empty($v)) { - throw new \InvalidArgumentException("{$k} is required."); - } - } - } - - public static function validateRequired($fieldName, $field, $val = null) - { - if (true === $val && null === $field) { - throw new \InvalidArgumentException($fieldName . ' is required'); - } - } - - public static function validateMaxLength($fieldName, $field, $val = null) - { - if (null !== $field && \strlen($field) > (int) $val) { - throw new \InvalidArgumentException($fieldName . ' is exceed max-length: ' . $val); - } - } - - public static function validateMinLength($fieldName, $field, $val = null) - { - if (null !== $field && \strlen($field) < (int) $val) { - throw new \InvalidArgumentException($fieldName . ' is less than min-length: ' . $val); - } - } - - public static function validatePattern($fieldName, $field, $regex = '') - { - if (null !== $field && '' !== $field && !preg_match("/^{$regex}$/", $field)) { - throw new \InvalidArgumentException($fieldName . ' is not match ' . $regex); - } - } - - public static function validateMaximum($fieldName, $field, $val) - { - if (null !== $field && $field > $val) { - throw new \InvalidArgumentException($fieldName . ' cannot be greater than ' . $val); - } - } - - public static function validateMinimum($fieldName, $field, $val) - { - if (null !== $field && $field < $val) { - throw new \InvalidArgumentException($fieldName . ' cannot be less than ' . $val); - } - } - - /** - * @param array $map - * @param Model $model - * - * @return mixed - */ - public static function toModel($map, $model) - { - $names = $model->getName(); - $names = array_flip($names); - foreach ($map as $key => $value) { - $name = isset($names[$key]) ? $names[$key] : $key; - $model->{$name} = $value; - } - - return $model; - } -} diff --git a/vendor/alibabacloud/tea/src/Parameter.php b/vendor/alibabacloud/tea/src/Parameter.php deleted file mode 100644 index 0718d1e..0000000 --- a/vendor/alibabacloud/tea/src/Parameter.php +++ /dev/null @@ -1,49 +0,0 @@ -toArray()); - } - - /** - * @return array - */ - public function getRealParameters() - { - $array = []; - $obj = new ReflectionObject($this); - $properties = $obj->getProperties(); - - foreach ($properties as $property) { - $docComment = $property->getDocComment(); - $key = trim(Helper::findFromString($docComment, '@real', "\n")); - $value = $property->getValue($this); - $array[$key] = $value; - } - - return $array; - } - - /** - * @return array - */ - public function toArray() - { - return $this->getRealParameters(); - } -} diff --git a/vendor/alibabacloud/tea/src/Request.php b/vendor/alibabacloud/tea/src/Request.php deleted file mode 100644 index 2594842..0000000 --- a/vendor/alibabacloud/tea/src/Request.php +++ /dev/null @@ -1,119 +0,0 @@ -method = $method; - } - - /** - * These fields are compatible if you define other fields. - * Mainly for compatibility situations where the code generator cannot generate set properties. - * - * @return PsrRequest - */ - public function getPsrRequest() - { - $this->assertQuery($this->query); - - $request = clone $this; - - $uri = $request->getUri(); - if ($this->query) { - $uri = $uri->withQuery(http_build_query($this->query)); - } - - if ($this->port) { - $uri = $uri->withPort($this->port); - } - - if ($this->protocol) { - $uri = $uri->withScheme($this->protocol); - } - - if ($this->pathname) { - $uri = $uri->withPath($this->pathname); - } - - if (isset($this->headers['host'])) { - $uri = $uri->withHost($this->headers['host']); - } - - $request = $request->withUri($uri); - $request = $request->withMethod($this->method); - - if ('' !== $this->body && null !== $this->body) { - if ($this->body instanceof StreamInterface) { - $request = $request->withBody($this->body); - } else { - if (\function_exists('\GuzzleHttp\Psr7\stream_for')) { - // @deprecated stream_for will be removed in guzzlehttp/psr7:2.0 - $request = $request->withBody(\GuzzleHttp\Psr7\stream_for($this->body)); - } else { - $request = $request->withBody(\GuzzleHttp\Psr7\Utils::streamFor($this->body)); - } - } - } - - if ($this->headers) { - foreach ($this->headers as $key => $value) { - $request = $request->withHeader($key, $value); - } - } - - return $request; - } - - /** - * @param array $query - */ - private function assertQuery($query) - { - if (!\is_array($query)) { - throw new InvalidArgumentException('Query must be array.'); - } - } -} diff --git a/vendor/alibabacloud/tea/src/Response.php b/vendor/alibabacloud/tea/src/Response.php deleted file mode 100644 index 1eab91f..0000000 --- a/vendor/alibabacloud/tea/src/Response.php +++ /dev/null @@ -1,366 +0,0 @@ -getStatusCode(), - $response->getHeaders(), - $response->getBody(), - $response->getProtocolVersion(), - $response->getReasonPhrase() - ); - $this->headers = $response->getHeaders(); - $this->body = $response->getBody(); - $this->statusCode = $response->getStatusCode(); - if ($this->body->isSeekable()) { - $this->body->seek(0); - } - - if (Helper::isJson((string) $this->getBody())) { - $this->dot = new Dot($this->toArray()); - } else { - $this->dot = new Dot(); - } - } - - /** - * @return string - */ - public function __toString() - { - return (string) $this->getBody(); - } - - /** - * @param string $name - * - * @return null|mixed - */ - public function __get($name) - { - $data = $this->dot->all(); - if (!isset($data[$name])) { - return null; - } - - return json_decode(json_encode($data))->{$name}; - } - - /** - * @param string $name - * @param mixed $value - */ - public function __set($name, $value) - { - $this->dot->set($name, $value); - } - - /** - * @param string $name - * - * @return bool - */ - public function __isset($name) - { - return $this->dot->has($name); - } - - /** - * @param $offset - */ - public function __unset($offset) - { - $this->dot->delete($offset); - } - - /** - * @return array - */ - public function toArray() - { - return \GuzzleHttp\json_decode((string) $this->getBody(), true); - } - - /** - * @param array|int|string $keys - * @param mixed $value - */ - public function add($keys, $value = null) - { - return $this->dot->add($keys, $value); - } - - /** - * @return array - */ - public function all() - { - return $this->dot->all(); - } - - /** - * @param null|array|int|string $keys - */ - public function clear($keys = null) - { - return $this->dot->clear($keys); - } - - /** - * @param array|int|string $keys - */ - public function delete($keys) - { - return $this->dot->delete($keys); - } - - /** - * @param string $delimiter - * @param null|array $items - * @param string $prepend - * - * @return array - */ - public function flatten($delimiter = '.', $items = null, $prepend = '') - { - return $this->dot->flatten($delimiter, $items, $prepend); - } - - /** - * @param null|int|string $key - * @param mixed $default - * - * @return mixed - */ - public function get($key = null, $default = null) - { - return $this->dot->get($key, $default); - } - - /** - * @param array|int|string $keys - * - * @return bool - */ - public function has($keys) - { - return $this->dot->has($keys); - } - - /** - * @param null|array|int|string $keys - * - * @return bool - */ - public function isEmpty($keys = null) - { - return $this->dot->isEmpty($keys); - } - - /** - * @param array|self|string $key - * @param array|self $value - */ - public function merge($key, $value = []) - { - return $this->dot->merge($key, $value); - } - - /** - * @param array|self|string $key - * @param array|self $value - */ - public function mergeRecursive($key, $value = []) - { - return $this->dot->mergeRecursive($key, $value); - } - - /** - * @param array|self|string $key - * @param array|self $value - */ - public function mergeRecursiveDistinct($key, $value = []) - { - return $this->dot->mergeRecursiveDistinct($key, $value); - } - - /** - * @param null|int|string $key - * @param mixed $default - * - * @return mixed - */ - public function pull($key = null, $default = null) - { - return $this->dot->pull($key, $default); - } - - /** - * @param null|int|string $key - * @param mixed $value - * - * @return mixed - */ - public function push($key = null, $value = null) - { - return $this->dot->push($key, $value); - } - - /** - * Replace all values or values within the given key - * with an array or Dot object. - * - * @param array|self|string $key - * @param array|self $value - */ - public function replace($key, $value = []) - { - return $this->dot->replace($key, $value); - } - - /** - * Set a given key / value pair or pairs. - * - * @param array|int|string $keys - * @param mixed $value - */ - public function set($keys, $value = null) - { - return $this->dot->set($keys, $value); - } - - /** - * Replace all items with a given array. - * - * @param mixed $items - */ - public function setArray($items) - { - return $this->dot->setArray($items); - } - - /** - * Replace all items with a given array as a reference. - */ - public function setReference(array &$items) - { - return $this->dot->setReference($items); - } - - /** - * Return the value of a given key or all the values as JSON. - * - * @param mixed $key - * @param int $options - * - * @return string - */ - public function toJson($key = null, $options = 0) - { - return $this->dot->toJson($key, $options); - } - - /** - * Retrieve an external iterator. - */ - public function getIterator() - { - return $this->dot->getIterator(); - } - - /** - * Whether a offset exists. - * - * @param $offset - * - * @return bool - */ - public function offsetExists($offset) - { - return $this->dot->offsetExists($offset); - } - - /** - * Offset to retrieve. - * - * @param $offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return $this->dot->offsetGet($offset); - } - - /** - * Offset to set. - * - * @param $offset - * @param $value - */ - public function offsetSet($offset, $value) - { - $this->dot->offsetSet($offset, $value); - } - - /** - * Offset to unset. - * - * @param $offset - */ - public function offsetUnset($offset) - { - $this->dot->offsetUnset($offset); - } - - /** - * Count elements of an object. - * - * @param null $key - * - * @return int - */ - public function count($key = null) - { - return $this->dot->count($key); - } -} diff --git a/vendor/alibabacloud/tea/src/Tea.php b/vendor/alibabacloud/tea/src/Tea.php deleted file mode 100644 index e050f4a..0000000 --- a/vendor/alibabacloud/tea/src/Tea.php +++ /dev/null @@ -1,281 +0,0 @@ -getPsrRequest(); - } - - $config = self::resolveConfig($config); - - $res = self::client()->send( - $request, - $config - ); - - return new Response($res); - } - - /** - * @return PromiseInterface - */ - public static function sendAsync(RequestInterface $request, array $config = []) - { - if (method_exists($request, 'getPsrRequest')) { - $request = $request->getPsrRequest(); - } - - $config = self::resolveConfig($config); - - return self::client()->sendAsync( - $request, - $config - ); - } - - /** - * @return Client - */ - public static function client(array $config = []) - { - if (isset(self::$config['handler'])) { - $stack = self::$config['handler']; - } else { - $stack = HandlerStack::create(); - $stack->push(Middleware::mapResponse(static function (ResponseInterface $response) { - return new Response($response); - })); - } - - self::$config['handler'] = $stack; - - if (!isset(self::$config['on_stats'])) { - self::$config['on_stats'] = function (TransferStats $stats) { - Response::$info = $stats->getHandlerStats(); - }; - } - - $new_config = Helper::merge([self::$config, $config]); - - return new Client($new_config); - } - - /** - * @param string $method - * @param string|UriInterface $uri - * @param array $options - * - * @throws GuzzleException - * - * @return ResponseInterface - */ - public static function request($method, $uri, $options = []) - { - return self::client()->request($method, $uri, $options); - } - - /** - * @param string $method - * @param string $uri - * @param array $options - * - * @throws GuzzleException - * - * @return string - */ - public static function string($method, $uri, $options = []) - { - return (string) self::client()->request($method, $uri, $options) - ->getBody(); - } - - /** - * @param string $method - * @param string|UriInterface $uri - * @param array $options - * - * @return PromiseInterface - */ - public static function requestAsync($method, $uri, $options = []) - { - return self::client()->requestAsync($method, $uri, $options); - } - - /** - * @param string|UriInterface $uri - * @param array $options - * - * @throws GuzzleException - * - * @return null|mixed - */ - public static function getHeaders($uri, $options = []) - { - return self::request('HEAD', $uri, $options)->getHeaders(); - } - - /** - * @param string|UriInterface $uri - * @param string $key - * @param null|mixed $default - * - * @throws GuzzleException - * - * @return null|mixed - */ - public static function getHeader($uri, $key, $default = null) - { - $headers = self::getHeaders($uri); - - return isset($headers[$key][0]) ? $headers[$key][0] : $default; - } - - /** - * @param int $retryTimes - * @param float $now - * - * @return bool - */ - public static function allowRetry(array $runtime, $retryTimes, $now) - { - unset($now); - if (empty($runtime) || !isset($runtime['maxAttempts'])) { - return false; - } - $maxAttempts = $runtime['maxAttempts']; - $retry = empty($maxAttempts) ? 0 : (int) $maxAttempts; - - return $retry >= $retryTimes; - } - - /** - * @param int $retryTimes - * - * @return int - */ - public static function getBackoffTime(array $runtime, $retryTimes) - { - $backOffTime = 0; - $policy = isset($runtime['policy']) ? $runtime['policy'] : ''; - - if (empty($policy) || 'no' == $policy) { - return $backOffTime; - } - - $period = isset($runtime['period']) ? $runtime['period'] : ''; - if (null !== $period && '' !== $period) { - $backOffTime = (int) $period; - if ($backOffTime <= 0) { - return $retryTimes; - } - } - - return $backOffTime; - } - - public static function sleep($time) - { - sleep($time); - } - - public static function isRetryable($retry, $retryTimes = 0) - { - if ($retry instanceof TeaError) { - return true; - } - if (\is_array($retry)) { - $max = isset($retry['maxAttempts']) ? (int) ($retry['maxAttempts']) : 3; - - return $retryTimes <= $max; - } - - return false; - } - - /** - * @param mixed|Model[] ...$item - * - * @return mixed - */ - public static function merge(...$item) - { - $tmp = []; - $n = 0; - foreach ($item as $i) { - if (\is_object($i)) { - if ($i instanceof Model) { - $i = $i->toMap(); - } else { - $i = json_decode(json_encode($i), true); - } - } - if (null === $i) { - continue; - } - if (\is_array($i)) { - $tmp[$n++] = $i; - } - } - - if (\count($tmp)) { - return \call_user_func_array('array_merge', $tmp); - } - - return []; - } - - private static function resolveConfig(array $config = []) - { - $options = new Dot(['http_errors' => false]); - if (isset($config['httpProxy']) && !empty($config['httpProxy'])) { - $options->set('proxy.http', $config['httpProxy']); - } - if (isset($config['httpsProxy']) && !empty($config['httpsProxy'])) { - $options->set('proxy.https', $config['httpsProxy']); - } - if (isset($config['noProxy']) && !empty($config['noProxy'])) { - $options->set('proxy.no', $config['noProxy']); - } - // readTimeout&connectTimeout unit is millisecond - $read_timeout = isset($config['readTimeout']) && !empty($config['readTimeout']) ? (int) $config['readTimeout'] : 0; - $con_timeout = isset($config['connectTimeout']) && !empty($config['connectTimeout']) ? (int) $config['connectTimeout'] : 0; - // timeout unit is second - $options->set('timeout', ($read_timeout + $con_timeout) / 1000); - - return $options->all(); - } -} diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index f336b47..3b8f0bb 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -25,198 +25,42 @@ class InstalledVersions private static $installed = array ( 'root' => array ( - 'pretty_version' => 'dev-main', - 'version' => 'dev-main', + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', 'aliases' => array ( ), - 'reference' => '0de1303b8ad09f054f69b785c89e913c01bd7da9', + 'reference' => 'ea969dafca064e91129b0b39e76022338b24e150', 'name' => '__root__', ), 'versions' => array ( '__root__' => array ( - 'pretty_version' => 'dev-main', - 'version' => 'dev-main', + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', 'aliases' => array ( ), - 'reference' => '0de1303b8ad09f054f69b785c89e913c01bd7da9', + 'reference' => 'ea969dafca064e91129b0b39e76022338b24e150', ), - 'adbario/php-dot-notation' => + 'myclabs/php-enum' => array ( - 'pretty_version' => '2.2.0', - 'version' => '2.2.0.0', + 'pretty_version' => '1.8.4', + 'version' => '1.8.4.0', 'aliases' => array ( ), - 'reference' => 'eee4fc81296531e6aafba4c2bbccfc5adab1676e', + 'reference' => 'a867478eae49c9f59ece437ae7f9506bfaa27483', ), - 'alibabacloud/credentials' => + 'qiniu/php-sdk' => array ( - 'pretty_version' => '1.1.4', - 'version' => '1.1.4.0', + 'pretty_version' => 'v7.12.0', + 'version' => '7.12.0.0', 'aliases' => array ( ), - 'reference' => 'e79d4151ad8924c0cf79d4fe0ec151b8d7663a25', - ), - 'alibabacloud/darabonba-openapi' => - array ( - 'pretty_version' => '0.2.3', - 'version' => '0.2.3.0', - 'aliases' => - array ( - ), - 'reference' => 'ba04277fbcf837451ba571e6b37913a6e6a846ba', - ), - 'alibabacloud/dysmsapi-20170525' => - array ( - 'pretty_version' => '2.0.8', - 'version' => '2.0.8.0', - 'aliases' => - array ( - ), - 'reference' => '83501c93a869c52e77fca204d2ae802926f36612', - ), - 'alibabacloud/endpoint-util' => - array ( - 'pretty_version' => '0.1.1', - 'version' => '0.1.1.0', - 'aliases' => - array ( - ), - 'reference' => 'f3fe88a25d8df4faa3b0ae14ff202a9cc094e6c5', - ), - 'alibabacloud/openapi-util' => - array ( - 'pretty_version' => '0.1.9', - 'version' => '0.1.9.0', - 'aliases' => - array ( - ), - 'reference' => 'c5734b3e0c2c560fd11c280edbe6cbe6115c4fd9', - ), - 'alibabacloud/tea' => - array ( - 'pretty_version' => '3.1.22', - 'version' => '3.1.22.0', - 'aliases' => - array ( - ), - 'reference' => 'f9c9b2c927253a1c23a5381cc655e41311be7f65', - ), - 'alibabacloud/tea-utils' => - array ( - 'pretty_version' => '0.2.14', - 'version' => '0.2.14.0', - 'aliases' => - array ( - ), - 'reference' => '381df15cb4bdb58dbf596f94869ffd2ef680eddd', - ), - 'guzzlehttp/guzzle' => - array ( - 'pretty_version' => '7.4.0', - 'version' => '7.4.0.0', - 'aliases' => - array ( - ), - 'reference' => '868b3571a039f0ebc11ac8f344f4080babe2cb94', - ), - 'guzzlehttp/promises' => - array ( - 'pretty_version' => '1.5.1', - 'version' => '1.5.1.0', - 'aliases' => - array ( - ), - 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da', - ), - 'guzzlehttp/psr7' => - array ( - 'pretty_version' => '2.1.0', - 'version' => '2.1.0.0', - 'aliases' => - array ( - ), - 'reference' => '089edd38f5b8abba6cb01567c2a8aaa47cec4c72', - ), - 'lizhichao/one-sm' => - array ( - 'pretty_version' => '1.10', - 'version' => '1.10.0.0', - 'aliases' => - array ( - ), - 'reference' => '687a012a44a5bfd4d9143a0234e1060543be455a', - ), - 'psr/http-client' => - array ( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'aliases' => - array ( - ), - 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', - ), - 'psr/http-client-implementation' => - array ( - 'provided' => - array ( - 0 => '1.0', - ), - ), - 'psr/http-factory' => - array ( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'aliases' => - array ( - ), - 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', - ), - 'psr/http-factory-implementation' => - array ( - 'provided' => - array ( - 0 => '1.0', - ), - ), - 'psr/http-message' => - array ( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'aliases' => - array ( - ), - 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', - ), - 'psr/http-message-implementation' => - array ( - 'provided' => - array ( - 0 => '1.0', - ), - ), - 'ralouphie/getallheaders' => - array ( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', - 'aliases' => - array ( - ), - 'reference' => '120b605dfeb996808c31b6477290a714d356e822', - ), - 'symfony/deprecation-contracts' => - array ( - 'pretty_version' => 'v2.5.0', - 'version' => '2.5.0.0', - 'aliases' => - array ( - ), - 'reference' => '6f981ee24cf69ee7ce9736146d1c57c2780598a8', + 'reference' => '96971af3cc6151b32e4a9d61001e126624100538', ), ), ); diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index b26f1b1..bb58823 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -7,4 +7,5 @@ $baseDir = dirname($vendorDir); return array( 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', + 'Stringable' => $vendorDir . '/myclabs/php-enum/stubs/Stringable.php', ); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index e7c3182..8402a80 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -6,9 +6,6 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( - '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', - 'd767e4fc2dc52fe66584ab8c6684783e' => $vendorDir . '/adbario/php-dot-notation/src/helpers.php', - '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', + '841780ea2e1d6545ea3a253239d59c05' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/functions.php', + '5dd19d8a547b7318af0c3a93c8bd6565' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Http/Middleware/Middleware.php', ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 133e0f3..c86b675 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -6,18 +6,6 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( - 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), - 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), - 'OneSm\\' => array($vendorDir . '/lizhichao/one-sm/src'), - 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), - 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), - 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), - 'Darabonba\\OpenApi\\' => array($vendorDir . '/alibabacloud/darabonba-openapi/src'), - 'AlibabaCloud\\Tea\\Utils\\' => array($vendorDir . '/alibabacloud/tea-utils/src'), - 'AlibabaCloud\\Tea\\' => array($vendorDir . '/alibabacloud/tea/src'), - 'AlibabaCloud\\SDK\\Dysmsapi\\V20170525\\' => array($vendorDir . '/alibabacloud/dysmsapi-20170525/src'), - 'AlibabaCloud\\OpenApiUtil\\' => array($vendorDir . '/alibabacloud/openapi-util/src'), - 'AlibabaCloud\\Endpoint\\' => array($vendorDir . '/alibabacloud/endpoint-util/src'), - 'AlibabaCloud\\Credentials\\' => array($vendorDir . '/alibabacloud/credentials/src'), - 'Adbar\\' => array($vendorDir . '/adbario/php-dot-notation/src'), + 'Qiniu\\' => array($vendorDir . '/qiniu/php-sdk/src/Qiniu'), + 'MyCLabs\\Enum\\' => array($vendorDir . '/myclabs/php-enum/src'), ); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 34ebbda..eff9e8d 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -7,107 +7,35 @@ namespace Composer\Autoload; class ComposerStaticInit37139411339932a4777fccf21175e9cc { public static $files = array ( - '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', - 'd767e4fc2dc52fe66584ab8c6684783e' => __DIR__ . '/..' . '/adbario/php-dot-notation/src/helpers.php', - '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', + '841780ea2e1d6545ea3a253239d59c05' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/functions.php', + '5dd19d8a547b7318af0c3a93c8bd6565' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Http/Middleware/Middleware.php', ); public static $prefixLengthsPsr4 = array ( - 'P' => + 'Q' => array ( - 'Psr\\Http\\Message\\' => 17, - 'Psr\\Http\\Client\\' => 16, + 'Qiniu\\' => 6, ), - 'O' => + 'M' => array ( - 'OneSm\\' => 6, - ), - 'G' => - array ( - 'GuzzleHttp\\Psr7\\' => 16, - 'GuzzleHttp\\Promise\\' => 19, - 'GuzzleHttp\\' => 11, - ), - 'D' => - array ( - 'Darabonba\\OpenApi\\' => 18, - ), - 'A' => - array ( - 'AlibabaCloud\\Tea\\Utils\\' => 23, - 'AlibabaCloud\\Tea\\' => 17, - 'AlibabaCloud\\SDK\\Dysmsapi\\V20170525\\' => 36, - 'AlibabaCloud\\OpenApiUtil\\' => 25, - 'AlibabaCloud\\Endpoint\\' => 22, - 'AlibabaCloud\\Credentials\\' => 25, - 'Adbar\\' => 6, + 'MyCLabs\\Enum\\' => 13, ), ); public static $prefixDirsPsr4 = array ( - 'Psr\\Http\\Message\\' => + 'Qiniu\\' => array ( - 0 => __DIR__ . '/..' . '/psr/http-factory/src', - 1 => __DIR__ . '/..' . '/psr/http-message/src', + 0 => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu', ), - 'Psr\\Http\\Client\\' => + 'MyCLabs\\Enum\\' => array ( - 0 => __DIR__ . '/..' . '/psr/http-client/src', - ), - 'OneSm\\' => - array ( - 0 => __DIR__ . '/..' . '/lizhichao/one-sm/src', - ), - 'GuzzleHttp\\Psr7\\' => - array ( - 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', - ), - 'GuzzleHttp\\Promise\\' => - array ( - 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src', - ), - 'GuzzleHttp\\' => - array ( - 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', - ), - 'Darabonba\\OpenApi\\' => - array ( - 0 => __DIR__ . '/..' . '/alibabacloud/darabonba-openapi/src', - ), - 'AlibabaCloud\\Tea\\Utils\\' => - array ( - 0 => __DIR__ . '/..' . '/alibabacloud/tea-utils/src', - ), - 'AlibabaCloud\\Tea\\' => - array ( - 0 => __DIR__ . '/..' . '/alibabacloud/tea/src', - ), - 'AlibabaCloud\\SDK\\Dysmsapi\\V20170525\\' => - array ( - 0 => __DIR__ . '/..' . '/alibabacloud/dysmsapi-20170525/src', - ), - 'AlibabaCloud\\OpenApiUtil\\' => - array ( - 0 => __DIR__ . '/..' . '/alibabacloud/openapi-util/src', - ), - 'AlibabaCloud\\Endpoint\\' => - array ( - 0 => __DIR__ . '/..' . '/alibabacloud/endpoint-util/src', - ), - 'AlibabaCloud\\Credentials\\' => - array ( - 0 => __DIR__ . '/..' . '/alibabacloud/credentials/src', - ), - 'Adbar\\' => - array ( - 0 => __DIR__ . '/..' . '/adbario/php-dot-notation/src', + 0 => __DIR__ . '/..' . '/myclabs/php-enum/src', ), ); public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'Stringable' => __DIR__ . '/..' . '/myclabs/php-enum/stubs/Stringable.php', ); public static function getInitializer(ClassLoader $loader) diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index c0d4f94..38d4fee 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,37 +1,117 @@ { "packages": [ { - "name": "adbario/php-dot-notation", - "version": "2.2.0", - "version_normalized": "2.2.0.0", + "name": "myclabs/php-enum", + "version": "1.8.4", + "version_normalized": "1.8.4.0", "source": { "type": "git", - "url": "https://github.com/adbario/php-dot-notation.git", - "reference": "eee4fc81296531e6aafba4c2bbccfc5adab1676e" + "url": "https://github.com/myclabs/php-enum.git", + "reference": "a867478eae49c9f59ece437ae7f9506bfaa27483" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/adbario/php-dot-notation/zipball/eee4fc81296531e6aafba4c2bbccfc5adab1676e", - "reference": "eee4fc81296531e6aafba4c2bbccfc5adab1676e", - "shasum": "" + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/a867478eae49c9f59ece437ae7f9506bfaa27483", + "reference": "a867478eae49c9f59ece437ae7f9506bfaa27483", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-json": "*", - "php": ">=5.5" + "php": "^7.3 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.0|^5.0|^6.0", - "squizlabs/php_codesniffer": "^3.0" + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "1.*", + "vimeo/psalm": "^4.6.2" }, - "time": "2019-01-01T23:59:15+00:00", + "time": "2022-08-04T09:53:51+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "MyCLabs\\Enum\\": "src/" + }, + "classmap": [ + "stubs/Stringable.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP Enum contributors", + "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" + } + ], + "description": "PHP Enum implementation", + "homepage": "http://github.com/myclabs/php-enum", + "keywords": [ + "enum" + ], + "support": { + "issues": "https://github.com/myclabs/php-enum/issues", + "source": "https://github.com/myclabs/php-enum/tree/1.8.4" + }, + "funding": [ + { + "url": "https://github.com/mnapoli", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum", + "type": "tidelift" + } + ], + "install-path": "../myclabs/php-enum" + }, + { + "name": "qiniu/php-sdk", + "version": "v7.12.0", + "version_normalized": "7.12.0.0", + "source": { + "type": "git", + "url": "https://github.com/qiniu/php-sdk.git", + "reference": "96971af3cc6151b32e4a9d61001e126624100538" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/qiniu/php-sdk/zipball/96971af3cc6151b32e4a9d61001e126624100538", + "reference": "96971af3cc6151b32e4a9d61001e126624100538", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "myclabs/php-enum": "~1.5.2 || ~1.6.6 || ~1.7.7 || ~1.8.4", + "php": ">=5.3.3" + }, + "require-dev": { + "paragonie/random_compat": ">=2", + "phpunit/phpunit": "^4.8 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4", + "squizlabs/php_codesniffer": "^2.3 || ~3.6" + }, + "time": "2023-12-25T08:30:40+00:00", "type": "library", "installation-source": "dist", "autoload": { "files": [ - "src/helpers.php" + "src/Qiniu/functions.php", + "src/Qiniu/Http/Middleware/Middleware.php" ], "psr-4": { - "Adbar\\": "src" + "Qiniu\\": "src/Qiniu" } }, "notification-url": "https://packagist.org/downloads/", @@ -40,1077 +120,24 @@ ], "authors": [ { - "name": "Riku Särkinen", - "email": "riku@adbar.io" + "name": "Qiniu", + "email": "sdk@qiniu.com", + "homepage": "http://www.qiniu.com" } ], - "description": "PHP dot notation access to arrays", - "homepage": "https://github.com/adbario/php-dot-notation", + "description": "Qiniu Resource (Cloud) Storage SDK for PHP", + "homepage": "http://developer.qiniu.com/", "keywords": [ - "ArrayAccess", - "dotnotation" - ], - "support": { - "issues": "https://github.com/adbario/php-dot-notation/issues", - "source": "https://github.com/adbario/php-dot-notation/tree/2.x" - }, - "install-path": "../adbario/php-dot-notation" - }, - { - "name": "alibabacloud/credentials", - "version": "1.1.4", - "version_normalized": "1.1.4.0", - "source": { - "type": "git", - "url": "https://github.com/aliyun/credentials-php.git", - "reference": "e79d4151ad8924c0cf79d4fe0ec151b8d7663a25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/aliyun/credentials-php/zipball/e79d4151ad8924c0cf79d4fe0ec151b8d7663a25", - "reference": "e79d4151ad8924c0cf79d4fe0ec151b8d7663a25", - "shasum": "" - }, - "require": { - "adbario/php-dot-notation": "^2.2", - "alibabacloud/tea": "^3.0", - "ext-curl": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-openssl": "*", - "ext-simplexml": "*", - "ext-xmlwriter": "*", - "guzzlehttp/guzzle": "^6.3|^7.0", - "php": ">=5.6" - }, - "require-dev": { - "composer/composer": "^1.8", - "drupal/coder": "^8.3", - "ext-dom": "*", - "ext-pcre": "*", - "ext-sockets": "*", - "ext-spl": "*", - "mikey179/vfsstream": "^1.6", - "monolog/monolog": "^1.24", - "phpunit/phpunit": "^4.8.35|^5.4.3", - "psr/cache": "^1.0", - "symfony/dotenv": "^3.4", - "symfony/var-dumper": "^3.4" - }, - "suggest": { - "ext-sockets": "To use client-side monitoring" - }, - "time": "2021-06-08T10:49:34+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "AlibabaCloud\\Credentials\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Alibaba Cloud SDK", - "email": "sdk-team@alibabacloud.com", - "homepage": "http://www.alibabacloud.com" - } - ], - "description": "Alibaba Cloud Credentials for PHP", - "homepage": "https://www.alibabacloud.com/", - "keywords": [ - "alibaba", - "alibabacloud", - "aliyun", - "client", "cloud", - "credentials", - "library", + "qiniu", "sdk", - "tool" + "storage" ], "support": { - "issues": "https://github.com/aliyun/credentials-php/issues", - "source": "https://github.com/aliyun/credentials-php" + "issues": "https://github.com/qiniu/php-sdk/issues", + "source": "https://github.com/qiniu/php-sdk/tree/v7.12.0" }, - "install-path": "../alibabacloud/credentials" - }, - { - "name": "alibabacloud/darabonba-openapi", - "version": "0.2.3", - "version_normalized": "0.2.3.0", - "source": { - "type": "git", - "url": "https://github.com/alibabacloud-sdk-php/darabonba-openapi.git", - "reference": "ba04277fbcf837451ba571e6b37913a6e6a846ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/alibabacloud-sdk-php/darabonba-openapi/zipball/ba04277fbcf837451ba571e6b37913a6e6a846ba", - "reference": "ba04277fbcf837451ba571e6b37913a6e6a846ba", - "shasum": "" - }, - "require": { - "alibabacloud/credentials": "^1.1", - "alibabacloud/openapi-util": "^0.1.9", - "alibabacloud/tea-utils": "^0.2.0", - "php": ">5.5" - }, - "time": "2021-11-26T09:00:27+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Darabonba\\OpenApi\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Alibaba Cloud SDK", - "email": "sdk-team@alibabacloud.com" - } - ], - "description": "Alibaba Cloud OpenApi Client", - "support": { - "issues": "https://github.com/alibabacloud-sdk-php/darabonba-openapi/issues", - "source": "https://github.com/alibabacloud-sdk-php/darabonba-openapi/tree/0.2.3" - }, - "install-path": "../alibabacloud/darabonba-openapi" - }, - { - "name": "alibabacloud/dysmsapi-20170525", - "version": "2.0.8", - "version_normalized": "2.0.8.0", - "source": { - "type": "git", - "url": "https://github.com/alibabacloud-sdk-php/Dysmsapi-20170525.git", - "reference": "83501c93a869c52e77fca204d2ae802926f36612" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/alibabacloud-sdk-php/Dysmsapi-20170525/zipball/83501c93a869c52e77fca204d2ae802926f36612", - "reference": "83501c93a869c52e77fca204d2ae802926f36612", - "shasum": "" - }, - "require": { - "alibabacloud/darabonba-openapi": "^0.2.3", - "alibabacloud/endpoint-util": "^0.1.0", - "alibabacloud/openapi-util": "^0.1.9", - "alibabacloud/tea-utils": "^0.2.0", - "php": ">5.5" - }, - "time": "2021-11-29T06:08:47+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "AlibabaCloud\\SDK\\Dysmsapi\\V20170525\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Alibaba Cloud SDK", - "email": "sdk-team@alibabacloud.com" - } - ], - "description": "Alibaba Cloud Dysmsapi (20170525) SDK Library for PHP", - "support": { - "source": "https://github.com/alibabacloud-sdk-php/Dysmsapi-20170525/tree/2.0.8" - }, - "install-path": "../alibabacloud/dysmsapi-20170525" - }, - { - "name": "alibabacloud/endpoint-util", - "version": "0.1.1", - "version_normalized": "0.1.1.0", - "source": { - "type": "git", - "url": "https://github.com/alibabacloud-sdk-php/endpoint-util.git", - "reference": "f3fe88a25d8df4faa3b0ae14ff202a9cc094e6c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/alibabacloud-sdk-php/endpoint-util/zipball/f3fe88a25d8df4faa3b0ae14ff202a9cc094e6c5", - "reference": "f3fe88a25d8df4faa3b0ae14ff202a9cc094e6c5", - "shasum": "" - }, - "require": { - "php": ">5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35|^5.4.3" - }, - "time": "2020-06-04T10:57:15+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "AlibabaCloud\\Endpoint\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Alibaba Cloud SDK", - "email": "sdk-team@alibabacloud.com" - } - ], - "description": "Alibaba Cloud Endpoint Library for PHP", - "support": { - "source": "https://github.com/alibabacloud-sdk-php/endpoint-util/tree/0.1.1" - }, - "install-path": "../alibabacloud/endpoint-util" - }, - { - "name": "alibabacloud/openapi-util", - "version": "0.1.9", - "version_normalized": "0.1.9.0", - "source": { - "type": "git", - "url": "https://github.com/alibabacloud-sdk-php/openapi-util.git", - "reference": "c5734b3e0c2c560fd11c280edbe6cbe6115c4fd9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/alibabacloud-sdk-php/openapi-util/zipball/c5734b3e0c2c560fd11c280edbe6cbe6115c4fd9", - "reference": "c5734b3e0c2c560fd11c280edbe6cbe6115c4fd9", - "shasum": "" - }, - "require": { - "alibabacloud/tea": "^3.1", - "alibabacloud/tea-utils": "^0.2", - "lizhichao/one-sm": "^1.5", - "php": ">5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35|^5.4.3" - }, - "time": "2021-09-07T08:13:50+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "AlibabaCloud\\OpenApiUtil\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Alibaba Cloud SDK", - "email": "sdk-team@alibabacloud.com" - } - ], - "description": "Alibaba Cloud OpenApi Util", - "support": { - "issues": "https://github.com/alibabacloud-sdk-php/openapi-util/issues", - "source": "https://github.com/alibabacloud-sdk-php/openapi-util/tree/0.1.9" - }, - "install-path": "../alibabacloud/openapi-util" - }, - { - "name": "alibabacloud/tea", - "version": "3.1.22", - "version_normalized": "3.1.22.0", - "source": { - "type": "git", - "url": "https://github.com/aliyun/tea-php.git", - "reference": "f9c9b2c927253a1c23a5381cc655e41311be7f65" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/aliyun/tea-php/zipball/f9c9b2c927253a1c23a5381cc655e41311be7f65", - "reference": "f9c9b2c927253a1c23a5381cc655e41311be7f65", - "shasum": "" - }, - "require": { - "adbario/php-dot-notation": "^2.2", - "ext-curl": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-openssl": "*", - "ext-simplexml": "*", - "ext-xmlwriter": "*", - "guzzlehttp/guzzle": "^6.3|^7.0", - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "*", - "symfony/dotenv": "^3.4", - "symfony/var-dumper": "^3.4" - }, - "suggest": { - "ext-sockets": "To use client-side monitoring" - }, - "time": "2021-05-11T06:17:44+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "AlibabaCloud\\Tea\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Alibaba Cloud SDK", - "email": "sdk-team@alibabacloud.com", - "homepage": "http://www.alibabacloud.com" - } - ], - "description": "Client of Tea for PHP", - "homepage": "https://www.alibabacloud.com/", - "keywords": [ - "alibabacloud", - "client", - "cloud", - "tea" - ], - "support": { - "issues": "https://github.com/aliyun/tea-php/issues", - "source": "https://github.com/aliyun/tea-php" - }, - "install-path": "../alibabacloud/tea" - }, - { - "name": "alibabacloud/tea-utils", - "version": "0.2.14", - "version_normalized": "0.2.14.0", - "source": { - "type": "git", - "url": "https://github.com/alibabacloud-sdk-php/tea-utils.git", - "reference": "381df15cb4bdb58dbf596f94869ffd2ef680eddd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/alibabacloud-sdk-php/tea-utils/zipball/381df15cb4bdb58dbf596f94869ffd2ef680eddd", - "reference": "381df15cb4bdb58dbf596f94869ffd2ef680eddd", - "shasum": "" - }, - "require": { - "alibabacloud/tea": "^3.1", - "php": ">5.5" - }, - "time": "2021-02-02T10:10:58+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "AlibabaCloud\\Tea\\Utils\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Alibaba Cloud SDK", - "email": "sdk-team@alibabacloud.com" - } - ], - "description": "Alibaba Cloud Tea Utils for PHP", - "support": { - "issues": "https://github.com/aliyun/tea-util/issues", - "source": "https://github.com/aliyun/tea-util" - }, - "install-path": "../alibabacloud/tea-utils" - }, - { - "name": "guzzlehttp/guzzle", - "version": "7.4.0", - "version_normalized": "7.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/868b3571a039f0ebc11ac8f344f4080babe2cb94", - "reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94", - "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" - }, - "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-10-18T09:52:00+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.0" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", - "type": "tidelift" - } - ], - "install-path": "../guzzlehttp/guzzle" - }, - { - "name": "guzzlehttp/promises", - "version": "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": "lizhichao/one-sm", - "version": "1.10", - "version_normalized": "1.10.0.0", - "source": { - "type": "git", - "url": "https://github.com/lizhichao/sm.git", - "reference": "687a012a44a5bfd4d9143a0234e1060543be455a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/lizhichao/sm/zipball/687a012a44a5bfd4d9143a0234e1060543be455a", - "reference": "687a012a44a5bfd4d9143a0234e1060543be455a", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "time": "2021-05-26T06:19:22+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "OneSm\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "tanszhe", - "email": "1018595261@qq.com" - } - ], - "description": "国密sm3", - "keywords": [ - "php", - "sm3" - ], - "support": { - "issues": "https://github.com/lizhichao/sm/issues", - "source": "https://github.com/lizhichao/sm/tree/1.10" - }, - "funding": [ - { - "url": "https://www.vicsdf.com/img/w.jpg", - "type": "custom" - }, - { - "url": "https://www.vicsdf.com/img/z.jpg", - "type": "custom" - } - ], - "install-path": "../lizhichao/one-sm" - }, - { - "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" + "install-path": "../qiniu/php-sdk" } ], "dev": true, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 4bd83d3..7b1cc6f 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,198 +1,42 @@ array ( - 'pretty_version' => 'dev-main', - 'version' => 'dev-main', + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', 'aliases' => array ( ), - 'reference' => '0de1303b8ad09f054f69b785c89e913c01bd7da9', + 'reference' => 'ea969dafca064e91129b0b39e76022338b24e150', 'name' => '__root__', ), 'versions' => array ( '__root__' => array ( - 'pretty_version' => 'dev-main', - 'version' => 'dev-main', + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', 'aliases' => array ( ), - 'reference' => '0de1303b8ad09f054f69b785c89e913c01bd7da9', + 'reference' => 'ea969dafca064e91129b0b39e76022338b24e150', ), - 'adbario/php-dot-notation' => + 'myclabs/php-enum' => array ( - 'pretty_version' => '2.2.0', - 'version' => '2.2.0.0', + 'pretty_version' => '1.8.4', + 'version' => '1.8.4.0', 'aliases' => array ( ), - 'reference' => 'eee4fc81296531e6aafba4c2bbccfc5adab1676e', + 'reference' => 'a867478eae49c9f59ece437ae7f9506bfaa27483', ), - 'alibabacloud/credentials' => + 'qiniu/php-sdk' => array ( - 'pretty_version' => '1.1.4', - 'version' => '1.1.4.0', + 'pretty_version' => 'v7.12.0', + 'version' => '7.12.0.0', 'aliases' => array ( ), - 'reference' => 'e79d4151ad8924c0cf79d4fe0ec151b8d7663a25', - ), - 'alibabacloud/darabonba-openapi' => - array ( - 'pretty_version' => '0.2.3', - 'version' => '0.2.3.0', - 'aliases' => - array ( - ), - 'reference' => 'ba04277fbcf837451ba571e6b37913a6e6a846ba', - ), - 'alibabacloud/dysmsapi-20170525' => - array ( - 'pretty_version' => '2.0.8', - 'version' => '2.0.8.0', - 'aliases' => - array ( - ), - 'reference' => '83501c93a869c52e77fca204d2ae802926f36612', - ), - 'alibabacloud/endpoint-util' => - array ( - 'pretty_version' => '0.1.1', - 'version' => '0.1.1.0', - 'aliases' => - array ( - ), - 'reference' => 'f3fe88a25d8df4faa3b0ae14ff202a9cc094e6c5', - ), - 'alibabacloud/openapi-util' => - array ( - 'pretty_version' => '0.1.9', - 'version' => '0.1.9.0', - 'aliases' => - array ( - ), - 'reference' => 'c5734b3e0c2c560fd11c280edbe6cbe6115c4fd9', - ), - 'alibabacloud/tea' => - array ( - 'pretty_version' => '3.1.22', - 'version' => '3.1.22.0', - 'aliases' => - array ( - ), - 'reference' => 'f9c9b2c927253a1c23a5381cc655e41311be7f65', - ), - 'alibabacloud/tea-utils' => - array ( - 'pretty_version' => '0.2.14', - 'version' => '0.2.14.0', - 'aliases' => - array ( - ), - 'reference' => '381df15cb4bdb58dbf596f94869ffd2ef680eddd', - ), - 'guzzlehttp/guzzle' => - array ( - 'pretty_version' => '7.4.0', - 'version' => '7.4.0.0', - 'aliases' => - array ( - ), - 'reference' => '868b3571a039f0ebc11ac8f344f4080babe2cb94', - ), - 'guzzlehttp/promises' => - array ( - 'pretty_version' => '1.5.1', - 'version' => '1.5.1.0', - 'aliases' => - array ( - ), - 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da', - ), - 'guzzlehttp/psr7' => - array ( - 'pretty_version' => '2.1.0', - 'version' => '2.1.0.0', - 'aliases' => - array ( - ), - 'reference' => '089edd38f5b8abba6cb01567c2a8aaa47cec4c72', - ), - 'lizhichao/one-sm' => - array ( - 'pretty_version' => '1.10', - 'version' => '1.10.0.0', - 'aliases' => - array ( - ), - 'reference' => '687a012a44a5bfd4d9143a0234e1060543be455a', - ), - 'psr/http-client' => - array ( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'aliases' => - array ( - ), - 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', - ), - 'psr/http-client-implementation' => - array ( - 'provided' => - array ( - 0 => '1.0', - ), - ), - 'psr/http-factory' => - array ( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'aliases' => - array ( - ), - 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', - ), - 'psr/http-factory-implementation' => - array ( - 'provided' => - array ( - 0 => '1.0', - ), - ), - 'psr/http-message' => - array ( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'aliases' => - array ( - ), - 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', - ), - 'psr/http-message-implementation' => - array ( - 'provided' => - array ( - 0 => '1.0', - ), - ), - 'ralouphie/getallheaders' => - array ( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', - 'aliases' => - array ( - ), - 'reference' => '120b605dfeb996808c31b6477290a714d356e822', - ), - 'symfony/deprecation-contracts' => - array ( - 'pretty_version' => 'v2.5.0', - 'version' => '2.5.0.0', - 'aliases' => - array ( - ), - 'reference' => '6f981ee24cf69ee7ce9736146d1c57c2780598a8', + 'reference' => '96971af3cc6151b32e4a9d61001e126624100538', ), ), ); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php index a8b98d5..92370c5 100644 --- a/vendor/composer/platform_check.php +++ b/vendor/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 70205)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 70300)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { diff --git a/vendor/guzzlehttp/guzzle/CHANGELOG.md b/vendor/guzzlehttp/guzzle/CHANGELOG.md deleted file mode 100644 index c3acb77..0000000 --- a/vendor/guzzlehttp/guzzle/CHANGELOG.md +++ /dev/null @@ -1,1479 +0,0 @@ -# Change Log - -Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version. - -## 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 deleted file mode 100644 index fd2375d..0000000 --- a/vendor/guzzlehttp/guzzle/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 0025aa7..0000000 --- a/vendor/guzzlehttp/guzzle/README.md +++ /dev/null @@ -1,94 +0,0 @@ -![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 deleted file mode 100644 index 45417a7..0000000 --- a/vendor/guzzlehttp/guzzle/UPGRADING.md +++ /dev/null @@ -1,1253 +0,0 @@ -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 deleted file mode 100644 index 5d2025b..0000000 --- a/vendor/guzzlehttp/guzzle/composer.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "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" - }, - "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 deleted file mode 100644 index 6eca94e..0000000 --- a/vendor/guzzlehttp/guzzle/src/BodySummarizer.php +++ /dev/null @@ -1,28 +0,0 @@ -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 deleted file mode 100644 index 3e02e03..0000000 --- a/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php +++ /dev/null @@ -1,13 +0,0 @@ - '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 deleted file mode 100644 index 6aaee61..0000000 --- a/vendor/guzzlehttp/guzzle/src/ClientInterface.php +++ /dev/null @@ -1,84 +0,0 @@ -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 deleted file mode 100644 index d6757c6..0000000 --- a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php +++ /dev/null @@ -1,313 +0,0 @@ -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 deleted file mode 100644 index 7df374b..0000000 --- a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php +++ /dev/null @@ -1,79 +0,0 @@ - - */ -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 deleted file mode 100644 index 290236d..0000000 --- a/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php +++ /dev/null @@ -1,101 +0,0 @@ -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 deleted file mode 100644 index 5d51ca9..0000000 --- a/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php +++ /dev/null @@ -1,77 +0,0 @@ -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 deleted file mode 100644 index 7c04034..0000000 --- a/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php +++ /dev/null @@ -1,444 +0,0 @@ - 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 deleted file mode 100644 index a80956c..0000000 --- a/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php +++ /dev/null @@ -1,39 +0,0 @@ -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 deleted file mode 100644 index fa3ed69..0000000 --- a/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php +++ /dev/null @@ -1,9 +0,0 @@ -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, - $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 deleted file mode 100644 index 8055e06..0000000 --- a/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php +++ /dev/null @@ -1,10 +0,0 @@ -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 { - unset($conf[\CURLOPT_CAINFO]); - $conf[\CURLOPT_SSL_VERIFYHOST] = 0; - $conf[\CURLOPT_SSL_VERIFYPEER] = false; - } - } - - 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 deleted file mode 100644 index fe57ed5..0000000 --- a/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index ace0d84..0000000 --- a/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php +++ /dev/null @@ -1,257 +0,0 @@ - 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)) { - $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 deleted file mode 100644 index 224344d..0000000 --- a/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php +++ /dev/null @@ -1,112 +0,0 @@ -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 deleted file mode 100644 index a098884..0000000 --- a/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php +++ /dev/null @@ -1,42 +0,0 @@ -|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 deleted file mode 100644 index f045b52..0000000 --- a/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php +++ /dev/null @@ -1,51 +0,0 @@ -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 deleted file mode 100644 index e0a1d11..0000000 --- a/vendor/guzzlehttp/guzzle/src/HandlerStack.php +++ /dev/null @@ -1,275 +0,0 @@ -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 deleted file mode 100644 index 238770f..0000000 --- a/vendor/guzzlehttp/guzzle/src/MessageFormatter.php +++ /dev/null @@ -1,198 +0,0 @@ ->>>>>>>\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(); - 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 deleted file mode 100644 index a39ac24..0000000 --- a/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php +++ /dev/null @@ -1,18 +0,0 @@ -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 deleted file mode 100644 index 6277c61..0000000 --- a/vendor/guzzlehttp/guzzle/src/Pool.php +++ /dev/null @@ -1,125 +0,0 @@ - $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 deleted file mode 100644 index 7ca6283..0000000 --- a/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php +++ /dev/null @@ -1,104 +0,0 @@ -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 deleted file mode 100644 index 1dd3861..0000000 --- a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php +++ /dev/null @@ -1,216 +0,0 @@ - 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 deleted file mode 100644 index 20b31bc..0000000 --- a/vendor/guzzlehttp/guzzle/src/RequestOptions.php +++ /dev/null @@ -1,264 +0,0 @@ -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 deleted file mode 100644 index 93fa334..0000000 --- a/vendor/guzzlehttp/guzzle/src/TransferStats.php +++ /dev/null @@ -1,133 +0,0 @@ -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 deleted file mode 100644 index 91591da..0000000 --- a/vendor/guzzlehttp/guzzle/src/Utils.php +++ /dev/null @@ -1,382 +0,0 @@ -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 deleted file mode 100644 index a70d2cb..0000000 --- a/vendor/guzzlehttp/guzzle/src/functions.php +++ /dev/null @@ -1,167 +0,0 @@ - -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 deleted file mode 100644 index 8d5b3ef..0000000 --- a/vendor/guzzlehttp/promises/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index c175fec..0000000 --- a/vendor/guzzlehttp/promises/README.md +++ /dev/null @@ -1,547 +0,0 @@ -# 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 deleted file mode 100644 index c959fb3..0000000 --- a/vendor/guzzlehttp/promises/composer.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "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 deleted file mode 100644 index d2b5712..0000000 --- a/vendor/guzzlehttp/promises/src/AggregateException.php +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 8d038e9..0000000 --- a/vendor/guzzlehttp/promises/src/Create.php +++ /dev/null @@ -1,84 +0,0 @@ -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 deleted file mode 100644 index 1dda354..0000000 --- a/vendor/guzzlehttp/promises/src/Each.php +++ /dev/null @@ -1,90 +0,0 @@ - $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 deleted file mode 100644 index 38ecb59..0000000 --- a/vendor/guzzlehttp/promises/src/EachPromise.php +++ /dev/null @@ -1,255 +0,0 @@ -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 deleted file mode 100644 index 98f72a6..0000000 --- a/vendor/guzzlehttp/promises/src/FulfilledPromise.php +++ /dev/null @@ -1,84 +0,0 @@ -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 deleted file mode 100644 index c3ed8d0..0000000 --- a/vendor/guzzlehttp/promises/src/Is.php +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100644 index 7593905..0000000 --- a/vendor/guzzlehttp/promises/src/Promise.php +++ /dev/null @@ -1,278 +0,0 @@ -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 deleted file mode 100644 index e598331..0000000 --- a/vendor/guzzlehttp/promises/src/PromiseInterface.php +++ /dev/null @@ -1,97 +0,0 @@ -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 deleted file mode 100644 index e2f1377..0000000 --- a/vendor/guzzlehttp/promises/src/RejectionException.php +++ /dev/null @@ -1,48 +0,0 @@ -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 deleted file mode 100644 index f0fba2c..0000000 --- a/vendor/guzzlehttp/promises/src/TaskQueue.php +++ /dev/null @@ -1,67 +0,0 @@ -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 deleted file mode 100644 index 723d4d5..0000000 --- a/vendor/guzzlehttp/promises/src/TaskQueueInterface.php +++ /dev/null @@ -1,24 +0,0 @@ - - * 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 deleted file mode 100644 index c03d39d..0000000 --- a/vendor/guzzlehttp/promises/src/functions.php +++ /dev/null @@ -1,363 +0,0 @@ - - * 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 deleted file mode 100644 index 34cd171..0000000 --- a/vendor/guzzlehttp/promises/src/functions_include.php +++ /dev/null @@ -1,6 +0,0 @@ -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 deleted file mode 100644 index 51c7ec8..0000000 --- a/vendor/guzzlehttp/psr7/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index ed81c92..0000000 --- a/vendor/guzzlehttp/psr7/README.md +++ /dev/null @@ -1,823 +0,0 @@ -# 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 deleted file mode 100644 index 885aa1d..0000000 --- a/vendor/guzzlehttp/psr7/composer.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "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 deleted file mode 100644 index 967925f..0000000 --- a/vendor/guzzlehttp/psr7/src/AppendStream.php +++ /dev/null @@ -1,249 +0,0 @@ -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 deleted file mode 100644 index 21be8c0..0000000 --- a/vendor/guzzlehttp/psr7/src/BufferStream.php +++ /dev/null @@ -1,149 +0,0 @@ -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 deleted file mode 100644 index 7a70ee9..0000000 --- a/vendor/guzzlehttp/psr7/src/CachingStream.php +++ /dev/null @@ -1,148 +0,0 @@ -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 deleted file mode 100644 index d78070a..0000000 --- a/vendor/guzzlehttp/psr7/src/DroppingStream.php +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100644 index 3a08477..0000000 --- a/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php +++ /dev/null @@ -1,14 +0,0 @@ - */ - 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 deleted file mode 100644 index 0e79a71..0000000 --- a/vendor/guzzlehttp/psr7/src/Header.php +++ /dev/null @@ -1,69 +0,0 @@ -]+>|[^=]+/', $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 deleted file mode 100644 index 30be222..0000000 --- a/vendor/guzzlehttp/psr7/src/HttpFactory.php +++ /dev/null @@ -1,100 +0,0 @@ -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 deleted file mode 100644 index 8e3cf17..0000000 --- a/vendor/guzzlehttp/psr7/src/InflateStream.php +++ /dev/null @@ -1,34 +0,0 @@ - 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 deleted file mode 100644 index 6b60429..0000000 --- a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php +++ /dev/null @@ -1,40 +0,0 @@ -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 deleted file mode 100644 index 9762d38..0000000 --- a/vendor/guzzlehttp/psr7/src/LimitStream.php +++ /dev/null @@ -1,154 +0,0 @@ -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 deleted file mode 100644 index 9b825b3..0000000 --- a/vendor/guzzlehttp/psr7/src/Message.php +++ /dev/null @@ -1,242 +0,0 @@ -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 deleted file mode 100644 index 503c280..0000000 --- a/vendor/guzzlehttp/psr7/src/MessageTrait.php +++ /dev/null @@ -1,235 +0,0 @@ - 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 deleted file mode 100644 index dfa9425..0000000 --- a/vendor/guzzlehttp/psr7/src/MimeType.php +++ /dev/null @@ -1,130 +0,0 @@ - '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 deleted file mode 100644 index f76d7c6..0000000 --- a/vendor/guzzlehttp/psr7/src/MultipartStream.php +++ /dev/null @@ -1,153 +0,0 @@ -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 deleted file mode 100644 index 99e25b9..0000000 --- a/vendor/guzzlehttp/psr7/src/NoSeekStream.php +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index 4fd0ca9..0000000 --- a/vendor/guzzlehttp/psr7/src/Query.php +++ /dev/null @@ -1,113 +0,0 @@ - '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 deleted file mode 100644 index b17af66..0000000 --- a/vendor/guzzlehttp/psr7/src/Request.php +++ /dev/null @@ -1,157 +0,0 @@ - $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 deleted file mode 100644 index 4c6ee6f..0000000 --- a/vendor/guzzlehttp/psr7/src/Response.php +++ /dev/null @@ -1,160 +0,0 @@ - '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 deleted file mode 100644 index 3022401..0000000 --- a/vendor/guzzlehttp/psr7/src/Rfc7230.php +++ /dev/null @@ -1,23 +0,0 @@ -@,;:\\\"/[\]?={}\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 deleted file mode 100644 index 6ae3f9b..0000000 --- a/vendor/guzzlehttp/psr7/src/ServerRequest.php +++ /dev/null @@ -1,344 +0,0 @@ - $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 deleted file mode 100644 index d389427..0000000 --- a/vendor/guzzlehttp/psr7/src/Stream.php +++ /dev/null @@ -1,279 +0,0 @@ -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 deleted file mode 100644 index 56d4104..0000000 --- a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php +++ /dev/null @@ -1,155 +0,0 @@ -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 deleted file mode 100644 index 2a93464..0000000 --- a/vendor/guzzlehttp/psr7/src/StreamWrapper.php +++ /dev/null @@ -1,175 +0,0 @@ -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 deleted file mode 100644 index b1521bc..0000000 --- a/vendor/guzzlehttp/psr7/src/UploadedFile.php +++ /dev/null @@ -1,211 +0,0 @@ -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 deleted file mode 100644 index 3898f78..0000000 --- a/vendor/guzzlehttp/psr7/src/Uri.php +++ /dev/null @@ -1,733 +0,0 @@ - 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 deleted file mode 100644 index e12971e..0000000 --- a/vendor/guzzlehttp/psr7/src/UriNormalizer.php +++ /dev/null @@ -1,220 +0,0 @@ -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 deleted file mode 100644 index 426e5c9..0000000 --- a/vendor/guzzlehttp/psr7/src/UriResolver.php +++ /dev/null @@ -1,211 +0,0 @@ -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 deleted file mode 100644 index 6cc04ee..0000000 --- a/vendor/guzzlehttp/psr7/src/Utils.php +++ /dev/null @@ -1,412 +0,0 @@ - $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 deleted file mode 100644 index d69a683..0000000 --- a/vendor/guzzlehttp/psr7/vendor-bin/php-cs-fixer/composer.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "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 deleted file mode 100644 index bfbc727..0000000 --- a/vendor/guzzlehttp/psr7/vendor-bin/phpstan/composer.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "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 deleted file mode 100644 index 535a079..0000000 --- a/vendor/guzzlehttp/psr7/vendor-bin/psalm/composer.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "require": { - "php": "^7.2.5 || ^8.0", - "psalm/phar": "4.6.2" - }, - "config": { - "preferred-install": "dist" - } -} diff --git a/vendor/lizhichao/one-sm/.github/FUNDING.yml b/vendor/lizhichao/one-sm/.github/FUNDING.yml deleted file mode 100644 index d312585..0000000 --- a/vendor/lizhichao/one-sm/.github/FUNDING.yml +++ /dev/null @@ -1,5 +0,0 @@ -# 如果对你有帮助 欢迎打赏 - -custom: ["https://www.vicsdf.com/img/z.jpg","https://www.vicsdf.com/img/w.jpg"] - - diff --git a/vendor/lizhichao/one-sm/.github/workflows/sm.yml b/vendor/lizhichao/one-sm/.github/workflows/sm.yml deleted file mode 100644 index 24f30d2..0000000 --- a/vendor/lizhichao/one-sm/.github/workflows/sm.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: sm - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - - -jobs: - run: - runs-on: ubuntu-latest - strategy: - matrix: - php-versions: [ '5.6','7.0','7.1', '7.2', '7.4', '8.0' ] - name: PHP ${{ matrix.php-versions }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - coverage: none - ini-values: opcache.jit_buffer_size=256M, opcache.jit=1205, pcre.jit=1, opcache.enable=1, opcache.enable_cli=1 - - name: Check PHP Version - run: php -v && php -i | grep opcache - - name: Install Dependencies - run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - - name: Execute tests sm3 - run: php tests/sm3.php - - name: Execute tests sm4 - run: php tests/sm4.php diff --git a/vendor/lizhichao/one-sm/.gitignore b/vendor/lizhichao/one-sm/.gitignore deleted file mode 100644 index cc52049..0000000 --- a/vendor/lizhichao/one-sm/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/vendor -.idea -.vscode -.svn -.DS_Store -composer.lock -cache/ diff --git a/vendor/lizhichao/one-sm/.php_cs.dist b/vendor/lizhichao/one-sm/.php_cs.dist deleted file mode 100644 index 8617ec2..0000000 --- a/vendor/lizhichao/one-sm/.php_cs.dist +++ /dev/null @@ -1,65 +0,0 @@ -setRiskyAllowed(true) - ->setIndent(' ') - ->setRules([ - '@PSR2' => true, - '@PhpCsFixer' => true, - '@Symfony:risky' => true, - 'concat_space' => ['spacing' => 'one'], - 'array_syntax' => ['syntax' => 'short'], - 'array_indentation' => true, - 'combine_consecutive_unsets' => true, - 'method_separation' => true, - 'single_quote' => true, - 'declare_equal_normalize' => true, - 'function_typehint_space' => true, - 'hash_to_slash_comment' => true, - 'include' => true, - 'lowercase_cast' => true, - 'no_multiline_whitespace_before_semicolons' => true, - 'no_leading_import_slash' => true, - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_spaces_around_offset' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unused_imports' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'object_operator_without_whitespace' => true, - 'single_blank_line_before_namespace' => true, - 'single_class_element_per_statement' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'whitespace_after_comma_in_array' => true, - 'no_extra_consecutive_blank_lines' => [ - 'curly_brace_block', - 'extra', - 'parenthesis_brace_block', - 'square_brace_block', - 'throw', - 'use', - ], - 'binary_operator_spaces' => [ - 'align_double_arrow' => true, - 'align_equals' => true, - ], - 'braces' => [ - 'allow_single_line_closure' => true, - ], - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude('vendor') - ->exclude('tests') - ->in(__DIR__) - ); diff --git a/vendor/lizhichao/one-sm/README.md b/vendor/lizhichao/one-sm/README.md deleted file mode 100644 index bb07cda..0000000 --- a/vendor/lizhichao/one-sm/README.md +++ /dev/null @@ -1,100 +0,0 @@ -## php国密算法 - -- sm3 - - 字符串签名 - - 文件签名 -- sm4 - - ecb - - cbc - - cfb - - ofb - - ctr - -## 安装 - -```shell -composer require lizhichao/one-sm -``` - -## SM3签名 -```php -sign('abc') . PHP_EOL; -echo $sm3->sign(str_repeat("adfas哈哈哈", 100)) . PHP_EOL; - - -// 文件签名 -echo $sm3->signFile(__FILE__) . PHP_EOL; -``` -### 性能测试 -和 [openssl](https://github.com/openssl/openssl) , [SM3-PHP](https://github.com/DongyunLee/SM3-PHP) 性能测试 - -```shell -php bench.php -``` -结果 -``` -openssl:4901d7181a1024b8c0f59b8d3c5c6d96b4b707ad10e8ebc8ece5dc49364a3067 -one-sm3:4901d7181a1024b8c0f59b8d3c5c6d96b4b707ad10e8ebc8ece5dc49364a3067 -SM3-PHP:4901d7181a1024b8c0f59b8d3c5c6d96b4b707ad10e8ebc8ece5dc49364a3067 -openssl time:6.3741207122803ms -one-sm3 time:8.1770420074463ms -SM3-PHP time:1738.5928630829ms - -``` -[测试代码bench.php](https://github.com/lizhichao/sm/blob/master/bench.php) - - -## SM4加密 - -```php -enDataEcb($data); -// 加密后的长度和原数据长度一致 -var_dump(strlen($d) === $str_len); - -// ECB解密 -$d = $sm4->deDataEcb($d); -// 解密后和原数据相等 -var_dump(md5($d) === $sign); - - -// 初始化向量16位 -$iv = hex2bin(md5(2)); -// CBC加密 -$d = $sm4->enDataCbc($data, $iv); -// 加密后的长度和原数据长度一致 -var_dump(strlen($d)===$str_len); - -// CBC解密 -$d = $sm4->deDataCbc($d, $iv); -// 解密后和原数据相等 -var_dump(md5($d)===$sign); - -``` - -## 我的其他仓库 - -* [一个极简高性能php框架,支持[swoole | php-fpm ]环境](https://github.com/lizhichao/one) -* [clickhouse tcp 客户端](https://github.com/lizhichao/one-ck) -* [中文分词](https://github.com/lizhichao/VicWord) -* [nsq客户端](https://github.com/lizhichao/one-nsq) diff --git a/vendor/lizhichao/one-sm/bench.php b/vendor/lizhichao/one-sm/bench.php deleted file mode 100644 index 156f4d3..0000000 --- a/vendor/lizhichao/one-sm/bench.php +++ /dev/null @@ -1,97 +0,0 @@ -sign($str) . PHP_EOL; - - -$t2 = microtime(true); - -echo 'SM3-PHP:' . sm3($str) . PHP_EOL; - -$t3 = microtime(true); - -echo 'openssl time:'.($t1 - $t) * 1000 . 'ms' . PHP_EOL; -echo 'one-sm3 time:'.($t2 - $t1) * 1000 . 'ms' . PHP_EOL; -echo 'SM3-PHP time:'.($t3 - $t2) * 1000 . 'ms' . PHP_EOL; - -// 文件签名 -//echo \OneSm\Sm3::signFile(__FILE__) . PHP_EOL; \ No newline at end of file diff --git a/vendor/lizhichao/one-sm/composer.json b/vendor/lizhichao/one-sm/composer.json deleted file mode 100644 index 8d41b47..0000000 --- a/vendor/lizhichao/one-sm/composer.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "lizhichao/one-sm", - "type": "library", - "description": "国密sm3", - "keywords": [ - "php", - "sm3" - ], - "license": "Apache-2.0", - "authors": [ - { - "name": "tanszhe", - "email": "1018595261@qq.com" - } - ], - "require": { - "php": ">=5.6" - }, - "autoload": { - "psr-4": { - "OneSm\\": "src/" - } - } -} diff --git a/vendor/lizhichao/one-sm/src/Sm3.php b/vendor/lizhichao/one-sm/src/Sm3.php deleted file mode 100644 index d9eb75f..0000000 --- a/vendor/lizhichao/one-sm/src/Sm3.php +++ /dev/null @@ -1,142 +0,0 @@ -getK($l); - $bt = $this->getB($k); - $str = $str . $bt . pack('J', $l); - - $count = strlen($str); - $l = $count / $this->STR_LEN; - $vr = hex2bin($this->IV); - for ($i = 0; $i < $l; $i++) { - $vr = $this->cf($vr, substr($str, $i * $this->STR_LEN, $this->STR_LEN)); - } - return bin2hex($vr); - - } - - private function getK($l) - { - $v = $l % $this->LEN; - return $v + $this->STR_LEN < $this->LEN - ? $this->LEN - $this->STR_LEN - $v - 1 - : ($this->LEN * 2) - $this->STR_LEN - $v - 1; - } - - private function getB($k) - { - $arg = [128]; - $arg = array_merge($arg, array_fill(0, intval($k / 8), 0)); - return pack('C*', ...$arg); - } - - public function signFile($file) - { - $l = filesize($file) * 8; - $k = $this->getK($l); - $bt = $this->getB($k) . pack('J', $l); - - $hd = fopen($file, 'r'); - $vr = hex2bin($this->IV); - $str = fread($hd, $this->STR_LEN); - if ($l > $this->LEN - $this->STR_LEN - 1) { - do { - $vr = $this->cf($vr, $str); - $str = fread($hd, $this->STR_LEN); - } while (!feof($hd)); - } - - $str = $str . $bt; - $count = strlen($str) * 8; - $l = $count / $this->LEN; - for ($i = 0; $i < $l; $i++) { - $vr = $this->cf($vr, substr($str, $i * $this->STR_LEN, $this->STR_LEN)); - } - return bin2hex($vr); - } - - - private function t($i) - { - return $i < 16 ? 0x79cc4519 : 0x7a879d8a; - } - - private function cf($ai, $bi) - { - $wr = array_values(unpack('N*', $bi)); - for ($i = 16; $i < 68; $i++) { - $wr[$i] = $this->p1($wr[$i - 16] - ^ - $wr[$i - 9] - ^ - $this->lm($wr[$i - 3], 15)) - ^ - $this->lm($wr[$i - 13], 7) - ^ - $wr[$i - 6]; - } - $wr1 = []; - for ($i = 0; $i < 64; $i++) { - $wr1[] = $wr[$i] ^ $wr[$i + 4]; - } - - list($a, $b, $c, $d, $e, $f, $g, $h) = array_values(unpack('N*', $ai)); - - for ($i = 0; $i < 64; $i++) { - $ss1 = $this->lm( - ($this->lm($a, 12) + $e + $this->lm($this->t($i), $i % 32) & 0xffffffff), - 7); - $ss2 = $ss1 ^ $this->lm($a, 12); - $tt1 = ($this->ff($i, $a, $b, $c) + $d + $ss2 + $wr1[$i]) & 0xffffffff; - $tt2 = ($this->gg($i, $e, $f, $g) + $h + $ss1 + $wr[$i]) & 0xffffffff; - $d = $c; - $c = $this->lm($b, 9); - $b = $a; - $a = $tt1; - $h = $g; - $g = $this->lm($f, 19); - $f = $e; - $e = $this->p0($tt2); - } - - return pack('N*', $a, $b, $c, $d, $e, $f, $g, $h) ^ $ai; - } - - - private function ff($j, $x, $y, $z) - { - return $j < 16 ? $x ^ $y ^ $z : ($x & $y) | ($x & $z) | ($y & $z); - } - - private function gg($j, $x, $y, $z) - { - return $j < 16 ? $x ^ $y ^ $z : ($x & $y) | (~$x & $z); - } - - - private function lm($a, $n) - { - return ($a >> (32 - $n) | (($a << $n) & 0xffffffff)); - } - - private function p0($x) - { - return $x ^ $this->lm($x, 9) ^ $this->lm($x, 17); - } - - private function p1($x) - { - return $x ^ $this->lm($x, 15) ^ $this->lm($x, 23); - } - -} \ No newline at end of file diff --git a/vendor/lizhichao/one-sm/src/Sm4.php b/vendor/lizhichao/one-sm/src/Sm4.php deleted file mode 100644 index 4421d2f..0000000 --- a/vendor/lizhichao/one-sm/src/Sm4.php +++ /dev/null @@ -1,350 +0,0 @@ -ck16($key); - $this->crk($key); - } - - private function dd(&$data) - { - $n = strlen($data) % $this->len; - $data = $data . str_repeat($this->b, $n); - } - - private function ck16($str) - { - if (strlen($str) !== $this->len) { - throw new \Exception('秘钥长度为16位'); - } - } - - private function add($v) - { - $arr = unpack('N*', $v); - $max = 0xffffffff; - $j = 1; - for ($i = 4; $i > 0; $i--) { - if ($arr[$i] > $max - $j) { - $j = 1; - $arr[$i] = 0; - } else { - $arr[$i] += $j; - break; - } - } - return pack('N*', ...$arr); - } - - /** - * @param string $str 加密字符串 - * @param string $iv 初始化字符串16位 - * @return string - * @throws \Exception - */ - public function deDataCtr($str, $iv) - { - return $this->enDataCtr($str, $iv); - } - - /** - * @param string $str 加密字符串 - * @param string $iv 初始化字符串16位 - * @return string - * @throws \Exception - */ - public function enDataCtr($str, $iv) - { - $this->ck16($iv); - $r = ''; - $this->dd($str); - $l = strlen($str) / $this->len; - for ($i = 0; $i < $l; $i++) { - $s = substr($str, $i * $this->len, $this->len); - $tr = []; - $this->encode(array_values(unpack('N*', $iv)), $tr); - $s1 = pack('N*', ...$tr); - $s1 = $s1 ^ $s; - $iv = $this->add($iv); - $r .= $s1; - } - return $r; - } - - - /** - * @param string $str 加密字符串 - * @param string $iv 初始化字符串16位 - * @return string - * @throws \Exception - */ - public function enDataOfb($str, $iv) - { - $this->ck16($iv); - $r = ''; - $this->dd($str); - $l = strlen($str) / $this->len; - for ($i = 0; $i < $l; $i++) { - $s = substr($str, $i * $this->len, $this->len); - $tr = []; - $this->encode(array_values(unpack('N*', $iv)), $tr); - $iv = pack('N*', ...$tr); - $s1 = $s ^ $iv; - $r .= $s1; - } - return $r; - } - - /** - * @param string $str 加密字符串 - * @param string $iv 初始化字符串16位 - * @return string - * @throws \Exception - */ - public function deDataOfb($str, $iv) - { - return $this->enDataOfb($str, $iv); - } - - /** - * @param string $str 加密字符串 - * @param string $iv 初始化字符串16位 - * @return string - * @throws \Exception - */ - public function deDataCfb($str, $iv) - { - $this->ck16($iv); - $r = ''; - $this->dd($str); - $l = strlen($str) / $this->len; - for ($i = 0; $i < $l; $i++) { - $s = substr($str, $i * $this->len, $this->len); - $tr = []; - $this->encode(array_values(unpack('N*', $iv)), $tr); - $s1 = pack('N*', ...$tr); - $s1 = $s ^ $s1; - $iv = $s; - $r .= $s1; - } - return $r; - } - - /** - * @param string $str 加密字符串 - * @param string $iv 初始化字符串16位 - * @return string - * @throws \Exception - */ - public function enDataCfb($str, $iv) - { - $this->ck16($iv); - $r = ''; - $this->dd($str); - $l = strlen($str) / $this->len; - for ($i = 0; $i < $l; $i++) { - $s = substr($str, $i * $this->len, $this->len); - $tr = []; - $this->encode(array_values(unpack('N*', $iv)), $tr); - $s1 = pack('N*', ...$tr); - $iv = $s ^ $s1; - $r .= $iv; - } - return $r; - } - - - /** - * @param string $str 加密字符串 - * @param string $iv 初始化字符串16位 - * @return string - * @throws \Exception - */ - public function enDataCbc($str, $iv) - { - $this->ck16($iv); - $r = ''; - $this->dd($str); - $l = strlen($str) / $this->len; - for ($i = 0; $i < $l; $i++) { - $s = substr($str, $i * $this->len, $this->len); - $s = $iv ^ $s; - $tr = []; - $this->encode(array_values(unpack('N*', $s)), $tr); - $iv = pack('N*', ...$tr); - $r .= $iv; - } - return $r; - } - - /** - * @param string $str 加密字符串 - * @param string $iv 初始化字符串16位 - * @return string - * @throws \Exception - */ - public function deDataCbc($str, $iv) - { - $this->ck16($iv); - $r = ''; - $this->dd($str); - $l = strlen($str) / $this->len; - for ($i = 0; $i < $l; $i++) { - $s = substr($str, $i * $this->len, $this->len); - $tr = []; - $this->decode(array_values(unpack('N*', $s)), $tr); - $s1 = pack('N*', ...$tr); - $s1 = $iv ^ $s1; - $iv = $s; - $r .= $s1; - } - return $r; - } - - - /** - * @param string $str 加密字符串 - * @return string - */ - public function enDataEcb($str) - { - $r = []; - $this->dd($str); - $ar = unpack('N*', $str); - do { - $this->encode([current($ar), next($ar), next($ar), next($ar)], $r); - } while (next($ar)); - return pack('N*', ...$r); - } - - /** - * @param string $str 解密字符串 - * @return string - */ - public function deDataEcb($str) - { - $r = []; - $this->dd($str); - $ar = unpack('N*', $str); - do { - $this->decode([current($ar), next($ar), next($ar), next($ar)], $r); - } while (next($ar)); - return pack('N*', ...$r); - } - - private function encode($ar, &$r) - { - for ($i = 0; $i < 32; $i++) { - $ar[$i + 4] = $this->f($ar[$i], $ar[$i + 1], $ar[$i + 2], $ar[$i + 3], $this->rk[$i]); - } - $r[] = $ar[35]; - $r[] = $ar[34]; - $r[] = $ar[33]; - $r[] = $ar[32]; - } - - private function decode($ar, &$r) - { - for ($i = 0; $i < 32; $i++) { - $ar[$i + 4] = $this->f($ar[$i], $ar[$i + 1], $ar[$i + 2], $ar[$i + 3], $this->rk[31 - $i]); - } - $r[] = $ar[35]; - $r[] = $ar[34]; - $r[] = $ar[33]; - $r[] = $ar[32]; - } - - private function crk($key) - { - $keys = array_values(unpack('N*', $key)); - $keys = [ - $keys[0] ^ $this->fk[0], - $keys[1] ^ $this->fk[1], - $keys[2] ^ $this->fk[2], - $keys[3] ^ $this->fk[3] - ]; - for ($i = 0; $i < 32; $i++) { - $this->rk[] = $keys[] = $keys[$i] ^ $this->t1($keys[$i + 1] ^ $keys[$i + 2] ^ $keys[$i + 3] ^ $this->ck[$i]); - } - } - - private function lm($a, $n) - { - return ($a >> (32 - $n) | (($a << $n) & 0xffffffff)); - } - - private function f($x0, $x1, $x2, $x3, $r) - { - return $x0 ^ $this->t($x1 ^ $x2 ^ $x3 ^ $r); - } - - private function s($n) - { - return $this->Sbox[($n & 0xff)] | $this->Sbox[(($n >> 8) & 0xff)] << 8 | $this->Sbox[(($n >> 16) & 0xff)] << 16 | $this->Sbox[(($n >> 24) & 0xff)] << 24; - } - - private function t($n) - { - $b = $this->s($n); - return $b ^ $this->lm($b, 2) ^ $this->lm($b, 10) ^ $this->lm($b, 18) ^ $this->lm($b, 24); - } - - private function t1($n) - { - $b = $this->s($n); - return $b ^ $this->lm($b, 13) ^ $this->lm($b, 23); - } - - -} \ No newline at end of file diff --git a/vendor/lizhichao/one-sm/test.php b/vendor/lizhichao/one-sm/test.php deleted file mode 100644 index 2318a69..0000000 --- a/vendor/lizhichao/one-sm/test.php +++ /dev/null @@ -1,3 +0,0 @@ -sign('test')); - $pack = 'H' . (string)$size; - if (\strlen($secret) > $size) { - $secret = pack($pack, $sm3->sign($secret)); - } - $key = str_pad($secret, $size, \chr(0x00)); - $ipad = $key ^ str_repeat(\chr(0x36), $size); - $opad = $key ^ str_repeat(\chr(0x5C), $size); - $hmac = $sm3->sign($opad . pack($pack, $sm3->sign($ipad . $data))); - - return $raw_output ? pack($pack, $hmac) : $hmac; -} - -$sm3 = new \OneSm\Sm3(); -eq('66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0', $sm3->sign('abc')); -eq('1294da78431a20991584c68a669f2c59618e08bf0d7989f35f6ae1d7d570e143', $sm3->sign(str_repeat("adfas哈哈哈", 100))); -eq('1ab21d8355cfa17f8e61194831e81a8f22bec8c728fefb747ed035eb5082aa2b', $sm3->sign('')); - -eq( - '8e4bd77d8a10526fae772bb6014dfaed0335491e1cdfa92d3aca1481ae5d9a83', - hmac(str_repeat('abc', 1000), 'secret') -); -eq( - hex2bin('8e4bd77d8a10526fae772bb6014dfaed0335491e1cdfa92d3aca1481ae5d9a83'), - hmac(str_repeat('abc', 1000), 'secret', true) -); - diff --git a/vendor/lizhichao/one-sm/tests/sm4.php b/vendor/lizhichao/one-sm/tests/sm4.php deleted file mode 100644 index ff03288..0000000 --- a/vendor/lizhichao/one-sm/tests/sm4.php +++ /dev/null @@ -1,79 +0,0 @@ -enDataEcb($data); -// 加密后的长度和原数据长度一致 -eq(strlen($d), $str_len); -// 解密ecb -$d = $sm4->deDataEcb($d); -// 解密后和原数据相等 -eq(md5($d), $sign); - -echo "\n --- cbc --- \n"; -// 加密cbc -$d = $sm4->enDataCbc($data, $iv); -// 加密后的长度和原数据长度一致 -eq(strlen($d), $str_len); -// 解密cbc -$d = $sm4->deDataCbc($d, $iv); -// 解密后和原数据相等 -eq(md5($d), $sign); - -echo "\n --- ofb --- \n"; -// 加密ofb -$d = $sm4->enDataOfb($data, $iv); -// 加密后的长度和原数据长度一致 -eq(strlen($d), $str_len); -// 解密ofb -$d = $sm4->deDataOfb($d, $iv); -// 解密后和原数据相等 -eq(md5($d), $sign); - -echo "\n --- cfb --- \n"; - -// 加密cfb -$d = $sm4->enDatacfb($data, $iv); -// 加密后的长度和原数据长度一致 -eq(strlen($d), $str_len); -// 解密cfb -$d = $sm4->deDatacfb($d, $iv); -// 解密后和原数据相等 -eq(md5($d), $sign); - - -echo "\n --- ctr --- \n"; - -// 加密ctr -$d = $sm4->enDataCtr($data, $iv); -// 加密后的长度和原数据长度一致 -eq(strlen($d), $str_len); -// 解密ctr -$d = $sm4->deDataCtr($d, $iv); -// 解密后和原数据相等 -eq(md5($d), $sign); - -//ecb/cbc/cfb/ofb/ctr \ No newline at end of file diff --git a/vendor/myclabs/php-enum/LICENSE b/vendor/myclabs/php-enum/LICENSE new file mode 100644 index 0000000..2a8cf22 --- /dev/null +++ b/vendor/myclabs/php-enum/LICENSE @@ -0,0 +1,18 @@ +The MIT License (MIT) + +Copyright (c) 2015 My C-Labs + +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/myclabs/php-enum/README.md b/vendor/myclabs/php-enum/README.md new file mode 100644 index 0000000..681d55e --- /dev/null +++ b/vendor/myclabs/php-enum/README.md @@ -0,0 +1,194 @@ +# PHP Enum implementation inspired from SplEnum + +[![GitHub Actions][GA Image]][GA Link] +[![Latest Stable Version](https://poser.pugx.org/myclabs/php-enum/version.png)](https://packagist.org/packages/myclabs/php-enum) +[![Total Downloads](https://poser.pugx.org/myclabs/php-enum/downloads.png)](https://packagist.org/packages/myclabs/php-enum) +[![Psalm Shepherd][Shepherd Image]][Shepherd Link] + +Maintenance for this project is [supported via Tidelift](https://tidelift.com/subscription/pkg/packagist-myclabs-php-enum?utm_source=packagist-myclabs-php-enum&utm_medium=referral&utm_campaign=readme). + +## Why? + +First, and mainly, `SplEnum` is not integrated to PHP, you have to install the extension separately. + +Using an enum instead of class constants provides the following advantages: + +- You can use an enum as a parameter type: `function setAction(Action $action) {` +- You can use an enum as a return type: `function getAction() : Action {` +- You can enrich the enum with methods (e.g. `format`, `parse`, …) +- You can extend the enum to add new values (make your enum `final` to prevent it) +- You can get a list of all the possible values (see below) + +This Enum class is not intended to replace class constants, but only to be used when it makes sense. + +## Installation + +``` +composer require myclabs/php-enum +``` + +## Declaration + +```php +use MyCLabs\Enum\Enum; + +/** + * Action enum + */ +final class Action extends Enum +{ + private const VIEW = 'view'; + private const EDIT = 'edit'; +} +``` + +## Usage + +```php +$action = Action::VIEW(); + +// or with a dynamic key: +$action = Action::$key(); +// or with a dynamic value: +$action = Action::from($value); +// or +$action = new Action($value); +``` + +As you can see, static methods are automatically implemented to provide quick access to an enum value. + +One advantage over using class constants is to be able to use an enum as a parameter type: + +```php +function setAction(Action $action) { + // ... +} +``` + +## Documentation + +- `__construct()` The constructor checks that the value exist in the enum +- `__toString()` You can `echo $myValue`, it will display the enum value (value of the constant) +- `getValue()` Returns the current value of the enum +- `getKey()` Returns the key of the current value on Enum +- `equals()` Tests whether enum instances are equal (returns `true` if enum values are equal, `false` otherwise) + +Static methods: + +- `from()` Creates an Enum instance, checking that the value exist in the enum +- `toArray()` method Returns all possible values as an array (constant name in key, constant value in value) +- `keys()` Returns the names (keys) of all constants in the Enum class +- `values()` Returns instances of the Enum class of all Enum constants (constant name in key, Enum instance in value) +- `isValid()` Check if tested value is valid on enum set +- `isValidKey()` Check if tested key is valid on enum set +- `assertValidValue()` Assert the value is valid on enum set, throwing exception otherwise +- `search()` Return key for searched value + +### Static methods + +```php +final class Action extends Enum +{ + private const VIEW = 'view'; + private const EDIT = 'edit'; +} + +// Static method: +$action = Action::VIEW(); +$action = Action::EDIT(); +``` + +Static method helpers are implemented using [`__callStatic()`](http://www.php.net/manual/en/language.oop5.overloading.php#object.callstatic). + +If you care about IDE autocompletion, you can either implement the static methods yourself: + +```php +final class Action extends Enum +{ + private const VIEW = 'view'; + + /** + * @return Action + */ + public static function VIEW() { + return new Action(self::VIEW); + } +} +``` + +or you can use phpdoc (this is supported in PhpStorm for example): + +```php +/** + * @method static Action VIEW() + * @method static Action EDIT() + */ +final class Action extends Enum +{ + private const VIEW = 'view'; + private const EDIT = 'edit'; +} +``` + +## Native enums and migration +Native enum arrived to PHP in version 8.1: https://www.php.net/enumerations +If your project is running PHP 8.1+ or your library has it as a minimum requirement you should use it instead of this library. + +When migrating from `myclabs/php-enum`, the effort should be small if the usage was in the recommended way: +- private constants +- final classes +- no method overridden + +Changes for migration: +- Class definition should be changed from +```php +/** + * @method static Action VIEW() + * @method static Action EDIT() + */ +final class Action extends Enum +{ + private const VIEW = 'view'; + private const EDIT = 'edit'; +} +``` + to +```php +enum Action: string +{ + case VIEW = 'view'; + case EDIT = 'edit'; +} +``` +All places where the class was used as a type will continue to work. + +Usages and the change needed: + +| Operation | myclabs/php-enum | native enum | +|----------------------------------------------------------------|----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Obtain an instance will change from | `$enumCase = Action::VIEW()` | `$enumCase = Action::VIEW` | +| Create an enum from a backed value | `$enumCase = new Action('view')` | `$enumCase = Action::from('view')` | +| Get the backed value of the enum instance | `$enumCase->getValue()` | `$enumCase->value` | +| Compare two enum instances | `$enumCase1 == $enumCase2`
or
`$enumCase1->equals($enumCase2)` | `$enumCase1 === $enumCase2` | +| Get the key/name of the enum instance | `$enumCase->getKey()` | `$enumCase->name` | +| Get a list of all the possible instances of the enum | `Action::values()` | `Action::cases()` | +| Get a map of possible instances of the enum mapped by name | `Action::values()` | `array_combine(array_map(fn($case) => $case->name, Action::cases()), Action::cases())`
or
`(new ReflectionEnum(Action::class))->getConstants()` | +| Get a list of all possible names of the enum | `Action::keys()` | `array_map(fn($case) => $case->name, Action::cases())` | +| Get a list of all possible backed values of the enum | `Action::toArray()` | `array_map(fn($case) => $case->value, Action::cases())` | +| Get a map of possible backed values of the enum mapped by name | `Action::toArray()` | `array_combine(array_map(fn($case) => $case->name, Action::cases()), array_map(fn($case) => $case->value, Action::cases()))`
or
`array_map(fn($case) => $case->value, (new ReflectionEnum(Action::class))->getConstants()))` | + +## Related projects + +- [PHP 8.1+ native enum](https://www.php.net/enumerations) +- [Doctrine enum mapping](https://github.com/acelaya/doctrine-enum-type) +- [Symfony ParamConverter integration](https://github.com/Ex3v/MyCLabsEnumParamConverter) +- [PHPStan integration](https://github.com/timeweb/phpstan-enum) + + +[GA Image]: https://github.com/myclabs/php-enum/workflows/CI/badge.svg + +[GA Link]: https://github.com/myclabs/php-enum/actions?query=workflow%3A%22CI%22+branch%3Amaster + +[Shepherd Image]: https://shepherd.dev/github/myclabs/php-enum/coverage.svg + +[Shepherd Link]: https://shepherd.dev/github/myclabs/php-enum diff --git a/vendor/myclabs/php-enum/SECURITY.md b/vendor/myclabs/php-enum/SECURITY.md new file mode 100644 index 0000000..84fd4e3 --- /dev/null +++ b/vendor/myclabs/php-enum/SECURITY.md @@ -0,0 +1,11 @@ +# Security Policy + +## Supported Versions + +Only the latest stable release is supported. + +## Reporting a Vulnerability + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). + +Tidelift will coordinate the fix and disclosure. diff --git a/vendor/myclabs/php-enum/composer.json b/vendor/myclabs/php-enum/composer.json new file mode 100644 index 0000000..978cb19 --- /dev/null +++ b/vendor/myclabs/php-enum/composer.json @@ -0,0 +1,36 @@ +{ + "name": "myclabs/php-enum", + "type": "library", + "description": "PHP Enum implementation", + "keywords": ["enum"], + "homepage": "http://github.com/myclabs/php-enum", + "license": "MIT", + "authors": [ + { + "name": "PHP Enum contributors", + "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" + } + ], + "autoload": { + "psr-4": { + "MyCLabs\\Enum\\": "src/" + }, + "classmap": [ + "stubs/Stringable.php" + ] + }, + "autoload-dev": { + "psr-4": { + "MyCLabs\\Tests\\Enum\\": "tests/" + } + }, + "require": { + "php": "^7.3 || ^8.0", + "ext-json": "*" + }, + "require-dev": { + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "1.*", + "vimeo/psalm": "^4.6.2" + } +} diff --git a/vendor/myclabs/php-enum/src/Enum.php b/vendor/myclabs/php-enum/src/Enum.php new file mode 100644 index 0000000..4c94cf6 --- /dev/null +++ b/vendor/myclabs/php-enum/src/Enum.php @@ -0,0 +1,318 @@ + + * @author Daniel Costa + * @author Mirosław Filip + * + * @psalm-template T + * @psalm-immutable + * @psalm-consistent-constructor + */ +abstract class Enum implements \JsonSerializable, \Stringable +{ + /** + * Enum value + * + * @var mixed + * @psalm-var T + */ + protected $value; + + /** + * Enum key, the constant name + * + * @var string + */ + private $key; + + /** + * Store existing constants in a static cache per object. + * + * + * @var array + * @psalm-var array> + */ + protected static $cache = []; + + /** + * Cache of instances of the Enum class + * + * @var array + * @psalm-var array> + */ + protected static $instances = []; + + /** + * Creates a new value of some type + * + * @psalm-pure + * @param mixed $value + * + * @psalm-param T $value + * @throws \UnexpectedValueException if incompatible type is given. + */ + public function __construct($value) + { + if ($value instanceof static) { + /** @psalm-var T */ + $value = $value->getValue(); + } + + /** @psalm-suppress ImplicitToStringCast assertValidValueReturningKey returns always a string but psalm has currently an issue here */ + $this->key = static::assertValidValueReturningKey($value); + + /** @psalm-var T */ + $this->value = $value; + } + + /** + * This method exists only for the compatibility reason when deserializing a previously serialized version + * that didn't had the key property + */ + public function __wakeup() + { + /** @psalm-suppress DocblockTypeContradiction key can be null when deserializing an enum without the key */ + if ($this->key === null) { + /** + * @psalm-suppress InaccessibleProperty key is not readonly as marked by psalm + * @psalm-suppress PossiblyFalsePropertyAssignmentValue deserializing a case that was removed + */ + $this->key = static::search($this->value); + } + } + + /** + * @param mixed $value + * @return static + */ + public static function from($value): self + { + $key = static::assertValidValueReturningKey($value); + + return self::__callStatic($key, []); + } + + /** + * @psalm-pure + * @return mixed + * @psalm-return T + */ + public function getValue() + { + return $this->value; + } + + /** + * Returns the enum key (i.e. the constant name). + * + * @psalm-pure + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * @psalm-pure + * @psalm-suppress InvalidCast + * @return string + */ + public function __toString() + { + return (string)$this->value; + } + + /** + * Determines if Enum should be considered equal with the variable passed as a parameter. + * Returns false if an argument is an object of different class or not an object. + * + * This method is final, for more information read https://github.com/myclabs/php-enum/issues/4 + * + * @psalm-pure + * @psalm-param mixed $variable + * @return bool + */ + final public function equals($variable = null): bool + { + return $variable instanceof self + && $this->getValue() === $variable->getValue() + && static::class === \get_class($variable); + } + + /** + * Returns the names (keys) of all constants in the Enum class + * + * @psalm-pure + * @psalm-return list + * @return array + */ + public static function keys() + { + return \array_keys(static::toArray()); + } + + /** + * Returns instances of the Enum class of all Enum constants + * + * @psalm-pure + * @psalm-return array + * @return static[] Constant name in key, Enum instance in value + */ + public static function values() + { + $values = array(); + + /** @psalm-var T $value */ + foreach (static::toArray() as $key => $value) { + $values[$key] = new static($value); + } + + return $values; + } + + /** + * Returns all possible values as an array + * + * @psalm-pure + * @psalm-suppress ImpureStaticProperty + * + * @psalm-return array + * @return array Constant name in key, constant value in value + */ + public static function toArray() + { + $class = static::class; + + if (!isset(static::$cache[$class])) { + /** @psalm-suppress ImpureMethodCall this reflection API usage has no side-effects here */ + $reflection = new \ReflectionClass($class); + /** @psalm-suppress ImpureMethodCall this reflection API usage has no side-effects here */ + static::$cache[$class] = $reflection->getConstants(); + } + + return static::$cache[$class]; + } + + /** + * Check if is valid enum value + * + * @param $value + * @psalm-param mixed $value + * @psalm-pure + * @psalm-assert-if-true T $value + * @return bool + */ + public static function isValid($value) + { + return \in_array($value, static::toArray(), true); + } + + /** + * Asserts valid enum value + * + * @psalm-pure + * @psalm-assert T $value + * @param mixed $value + */ + public static function assertValidValue($value): void + { + self::assertValidValueReturningKey($value); + } + + /** + * Asserts valid enum value + * + * @psalm-pure + * @psalm-assert T $value + * @param mixed $value + * @return string + */ + private static function assertValidValueReturningKey($value): string + { + if (false === ($key = static::search($value))) { + throw new \UnexpectedValueException("Value '$value' is not part of the enum " . static::class); + } + + return $key; + } + + /** + * Check if is valid enum key + * + * @param $key + * @psalm-param string $key + * @psalm-pure + * @return bool + */ + public static function isValidKey($key) + { + $array = static::toArray(); + + return isset($array[$key]) || \array_key_exists($key, $array); + } + + /** + * Return key for value + * + * @param mixed $value + * + * @psalm-param mixed $value + * @psalm-pure + * @return string|false + */ + public static function search($value) + { + return \array_search($value, static::toArray(), true); + } + + /** + * Returns a value when called statically like so: MyEnum::SOME_VALUE() given SOME_VALUE is a class constant + * + * @param string $name + * @param array $arguments + * + * @return static + * @throws \BadMethodCallException + * + * @psalm-pure + */ + public static function __callStatic($name, $arguments) + { + $class = static::class; + if (!isset(self::$instances[$class][$name])) { + $array = static::toArray(); + if (!isset($array[$name]) && !\array_key_exists($name, $array)) { + $message = "No static method or enum constant '$name' in class " . static::class; + throw new \BadMethodCallException($message); + } + return self::$instances[$class][$name] = new static($array[$name]); + } + return clone self::$instances[$class][$name]; + } + + /** + * Specify data which should be serialized to JSON. This method returns data that can be serialized by json_encode() + * natively. + * + * @return mixed + * @link http://php.net/manual/en/jsonserializable.jsonserialize.php + * @psalm-pure + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return $this->getValue(); + } +} diff --git a/vendor/myclabs/php-enum/src/PHPUnit/Comparator.php b/vendor/myclabs/php-enum/src/PHPUnit/Comparator.php new file mode 100644 index 0000000..302bf80 --- /dev/null +++ b/vendor/myclabs/php-enum/src/PHPUnit/Comparator.php @@ -0,0 +1,54 @@ +register(new \MyCLabs\Enum\PHPUnit\Comparator()); + */ +final class Comparator extends \SebastianBergmann\Comparator\Comparator +{ + public function accepts($expected, $actual) + { + return $expected instanceof Enum && ( + $actual instanceof Enum || $actual === null + ); + } + + /** + * @param Enum $expected + * @param Enum|null $actual + * + * @return void + */ + public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false) + { + if ($expected->equals($actual)) { + return; + } + + throw new ComparisonFailure( + $expected, + $actual, + $this->formatEnum($expected), + $this->formatEnum($actual), + false, + 'Failed asserting that two Enums are equal.' + ); + } + + private function formatEnum(Enum $enum = null) + { + if ($enum === null) { + return "null"; + } + + return get_class($enum)."::{$enum->getKey()}()"; + } +} diff --git a/vendor/myclabs/php-enum/stubs/Stringable.php b/vendor/myclabs/php-enum/stubs/Stringable.php new file mode 100644 index 0000000..4811af7 --- /dev/null +++ b/vendor/myclabs/php-enum/stubs/Stringable.php @@ -0,0 +1,11 @@ +=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 deleted file mode 100644 index cb39a08..0000000 --- a/vendor/psr/http-factory/src/RequestFactoryInterface.php +++ /dev/null @@ -1,18 +0,0 @@ -=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 deleted file mode 100644 index dd46e5e..0000000 --- a/vendor/psr/http-message/src/MessageInterface.php +++ /dev/null @@ -1,187 +0,0 @@ -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 deleted file mode 100644 index a96d4fd..0000000 --- a/vendor/psr/http-message/src/RequestInterface.php +++ /dev/null @@ -1,129 +0,0 @@ -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 deleted file mode 100644 index f68f391..0000000 --- a/vendor/psr/http-message/src/StreamInterface.php +++ /dev/null @@ -1,158 +0,0 @@ - - * [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/qiniu/php-sdk/.github/workflows/test-ci.yml b/vendor/qiniu/php-sdk/.github/workflows/test-ci.yml new file mode 100644 index 0000000..c76b39e --- /dev/null +++ b/vendor/qiniu/php-sdk/.github/workflows/test-ci.yml @@ -0,0 +1,71 @@ +name: PHP CI with Composer + +on: [push, pull_request] + +jobs: + build: + strategy: + fail-fast: false + matrix: + php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup php for mock server + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: '1.21.x' + + - name: Setup build-in server + run: | + nohup php -S localhost:9000 -t ./tests/mock-server/ > phpd.log 2>&1 & + echo $! > mock-server.pid + + cd tests/socks5-server/ + nohup go run main.go > ../../socks5.log 2>&1 & + echo $! > ../../socks-server.pid + + - name: Setup php + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + + - name: Install dependencies + run: | + composer self-update + composer install --no-interaction --prefer-source --dev + + - name: Run cases + run: | + ./vendor/bin/phpcs --standard=PSR2 src + ./vendor/bin/phpcs --standard=PSR2 examples + ./vendor/bin/phpcs --standard=PSR2 tests + ./vendor/bin/phpunit --coverage-clover=coverage.xml + cat mock-server.pid | xargs kill + cat socks-server.pid | xargs kill + + env: + QINIU_ACCESS_KEY: ${{ secrets.QINIU_ACCESS_KEY }} + QINIU_SECRET_KEY: ${{ secrets.QINIU_SECRET_KEY }} + QINIU_TEST_BUCKET: ${{ secrets.QINIU_TEST_BUCKET }} + QINIU_TEST_DOMAIN: ${{ secrets.QINIU_TEST_DOMAIN }} + + - name: Print mock servion log + if: ${{ failure() }} + run: | + cat phpd.log + + - name: Print socks5 server log + if: ${{ failure() }} + run: | + cat socks5.log + + - name: After_success + run: bash <(curl -s https://codecov.io/bash) diff --git a/vendor/qiniu/php-sdk/.gitignore b/vendor/qiniu/php-sdk/.gitignore new file mode 100644 index 0000000..4c842c8 --- /dev/null +++ b/vendor/qiniu/php-sdk/.gitignore @@ -0,0 +1,12 @@ +*.phar +*.zip +build/artifacts +phpunit.xml +phpunit.functional.xml +.DS_Store +.swp +.build +composer.lock +vendor +src/package.xml +.idea/ diff --git a/vendor/qiniu/php-sdk/.scrutinizer.yml b/vendor/qiniu/php-sdk/.scrutinizer.yml new file mode 100644 index 0000000..6a2d0d8 --- /dev/null +++ b/vendor/qiniu/php-sdk/.scrutinizer.yml @@ -0,0 +1,42 @@ +filter: + excluded_paths: [tests/*] +checks: + php: + code_rating: true + remove_extra_empty_lines: true + remove_php_closing_tag: true + remove_trailing_whitespace: true + fix_use_statements: + remove_unused: true + preserve_multiple: false + preserve_blanklines: true + order_alphabetically: true + fix_php_opening_tag: true + fix_linefeed: true + fix_line_ending: true + fix_identation_4spaces: true + fix_doc_comments: true +tools: + external_code_coverage: + timeout: 1200 + runs: 3 + php_analyzer: true + php_code_coverage: false + php_code_sniffer: + config: + standard: PSR2 + filter: + paths: ['src'] + php_loc: + enabled: true + excluded_dirs: [vendor, tests] + php_cpd: + enabled: true + excluded_dirs: [vendor, tests] +build: + nodes: + analysis: + tests: + override: + - php-scrutinizer-run + diff --git a/vendor/qiniu/php-sdk/CHANGELOG.md b/vendor/qiniu/php-sdk/CHANGELOG.md new file mode 100644 index 0000000..1f750ea --- /dev/null +++ b/vendor/qiniu/php-sdk/CHANGELOG.md @@ -0,0 +1,185 @@ +# Changelog + +## 7.12.0 (2023-12-11) +* 对象存储,支持归档直读存储 +* 对象存储,批量操作支持自动查询 rs 服务域名 + +## 7.11.0 (2023-09-05) +* 支持代理 + +## 7.10.1 (2023-08-04) +* 修复部分 API 调用中间件合并失败(#417) + +## 7.10.0 (2023-06-20) +* 对象存储,新增请求中间件逻辑,方便拓展请求逻辑 +* 对象存储,新增备用 UC 域名用于查询区域域名 +* 对象存储,修复分片上传初始化失败无法快速失败 +* 对象存储,移除首尔区域 + +## 7.9.0 (2023-03-31) +* 对象存储,修复无法对 key 为空字符串的对象进行操作 +* 修复 301 重定向无法正确获取 header 信息 +* 对象存储,新增查询区域域名过期时间 +* 对象存储,更新获取区域域名的接口 +* 对象存储,更新查询 bucket 域名为 uc 服务 +* 对象存储,新增 uc 服务可配置 + +## 7.8.0 (2022-10-25) +* 移除不推荐域名,并增加区域亚太-首尔和华东-浙江2 +* 对象存储,修复断点上传的文件内容不正确 +* 对象存储,优化分片上传 ctx 超时检测 + +## 7.7.0 (2022-09-02) +* 对象存储,新增支持设置文件级别生命周期 setObjectLifecycle API +* 对象存储,内置增加七牛新建存储区域域名信息 +* 修复当前已知问题 + +## 7.6.0 (2022-06-08) +* 对象存储,管理类 API 发送请求时增加 [X-Qiniu-Date](https://developer.qiniu.com/kodo/3924/common-request-headers) (生成请求的时间) header + + +## 7.5.0 (2022-04-18) +* 对象存储,新增支持 [深度归档存储类型](https://developer.qiniu.com/kodo/3956/kodo-category#deep_archive) + +## 7.4.3 (2022-04-01) +* 优化签名算法逻辑 + +## 7.4.2(2022-03-01) +* 修复已知关于请求 Header 处理不当问题,比如没有处理为大小写不敏感等问题 + +## 7.4.1(2021-09-24) +* 修复了 分片上传 v2 已知问题,明确给出了参数不合理情况下对应的错误提示信息 + +## 7.4.0 (2021-07-19) +* 【对象存储】支持 [分片上传 v2](https://developer.qiniu.com/kodo/7458/multipartupload) 和 断点续传,使用方式见 [开发者文档](https://developer.qiniu.com/kodo/1241/php#resume-upload-file) + +## 7.3.0 (2020-09-24) +### 新增 +* 【对象存储】增加异步抓取方法与demo +* 【融合cdn】增加查询CDN刷新记录、查询CDN预取记录方法与demo +* 【云短信】增加查询短信发送记录的方法 +* 【实时音视频】增加rtc停止房间的合流转推方法 +* 【内容审核】增加图片审核、视频审核方法与demo + +### 修复 +* 【对象存储】修复签算 token 时上传策略中的 forceSaveKey 字段不生效的问题 +* 【对象存储】修复更新空间事件通知规则方法 + +### 优化 +* 【对象存储】创建空间迁移到mkbucketv3 api +* 优化对 http2 返回头的判断 +* 优化 demo 中的文档注释说明 +* docs 目录下的 rtc demo 移动至 examples/rtc 目录下 +* docs 目录下的 sms demo 移动至 examples/sms 目录下 + +## 7.2.10 (2019-10-28) +* 去除云短信类类型指定 +* 修改不传文件名时存在表单上传错误的情况 + +## 7.2.9 (2019-07-09) +* 添加空间管理、云短信接口 +* 去除无效参数 + +## 7.2.7 (2018-11-06) +* 添加 QVM 内网上传到 KODO 的 zone 设置 + +## 7.2.6 (2018-05-18) +* 修复rs,rsf在不同机房默认的https域名 + +## 7.2.5 (2018-05-10) +* 修复表单上传中多余的参数checkCrc导致的fname错位问题 + +## 7.2.4 (2018-05-09) +### 增加 +* 连麦功能 + +## 7.2.3 (2018-01-20) +### 增加 +* 新加坡机房 +### 修正 +* 获取域名的入口域名 +* http回复头部兼容大小写 + +## 7.2.2 (2017-11-06) +### 增加 +* Qiniu算法的鉴权方法 + +## 7.1.4 (2017-06-21) +### 增加 +* cdn 文件/目录 刷新 +* cdn 获取 流量/带宽 +* cdn 获取域名的访问日志列表 +* cdn 对资源链接进行时间戳防盗链签名 + +## 7.1.3 (2016-11-18) +### 增加 +* move, copy操作增加force参数 + +## 7.1.2 (2016-11-12) +### 修正 +* 明确抛出获取各区域域名失败时的报错 + +## 7.1.1 (2016-11-02) +### 修正 +* 多区域配置文件存储目录从home修改到tmp目录 + + +## 7.1.0 (2016-10-22) +### 增加 +* 多存储区域的支持 + +## 7.0.8 (2016-07-19) +### 增加 +* demo +* https url 支持 +* deleteAfterDays 策略 +* 添加图片处理链接统一拼接方法 by @SherlockRen + +## 7.0.7 (2016-01-12) +### 修正 +* PersistentFop参数pipeline和notify_url失效 +* resume 模式 close file inputstream + +## 7.0.6 (2015-12-05) +### 修正 +* php7.0 Json 对空字符串解析单元测试报错 +* 开启安全模式或者设置可操作目录树时,设置CURLOPT_FOLLOWLOCATION报错, by @twocabbages +* fetch 支持不指定key, by @sinkcup + +## 7.0.5 (2015-10-29) +### 增加 +* 增加上传策略最小文件大小限制 fsizeMin +* 增加常见examples + +## 7.0.4 (2015-07-23) +### 修正 +* 一些地方的严格比较检查 +* resumeupload 备用地址失效 + +## 7.0.3 (2015-07-10) +### 修改 +* 多zone 支持 + +## 7.0.2 (2015-04-18) +### 修改 +* fetch 接口返回内容调整 +* pfop 接口调整 + +###修正 +* exception 类调用 + +## 7.0.1 (2015-03-27) +### 增加 +* 增加代码注释 + +## 7.0.0 (2015-02-03) + +### 增加 +* 简化上传接口 +* 自动选择断点续上传还是直传 +* 重构代码,接口和内部结构更清晰 +* 改变mime +* 代码覆盖度报告 +* policy改为array, 便于灵活增加,并加入过期字段检查 +* 文件列表支持目录形式 +* 利用元编程方式支持 fop 和 pfop diff --git a/vendor/qiniu/php-sdk/CONTRIBUTING.md b/vendor/qiniu/php-sdk/CONTRIBUTING.md new file mode 100644 index 0000000..0466bf9 --- /dev/null +++ b/vendor/qiniu/php-sdk/CONTRIBUTING.md @@ -0,0 +1,30 @@ +# 贡献代码指南 + +我们非常欢迎大家来贡献代码,我们会向贡献者致以最诚挚的敬意。 + +一般可以通过在Github上提交[Pull Request](https://github.com/qiniu/php-sdk)来贡献代码。 + +## Pull Request要求 + +- **[PSR-2 编码风格标准](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** 。要通过项目中的code sniffer检查。 + +- **代码格式** 提交前 请按 ./vendor/bin/phpcbf --standard=PSR2 进行格式化。 + +- **必须添加测试!** - 如果没有测试(单元测试、集成测试都可以),那么提交的补丁是不会通过的。 + +- **记得更新文档** - 保证`README.md`以及其他相关文档及时更新,和代码的变更保持一致性。 + +- **考虑我们的发布周期** - 我们的版本号会服从[SemVer v2.0.0](http://semver.org/),我们绝对不会随意变更对外的API。 + +- **创建feature分支** - 最好不要从你的master分支提交 pull request。 + +- **一个feature提交一个pull请求** - 如果你的代码变更了多个操作,那就提交多个pull请求吧。 + +- **清晰的commit历史** - 保证你的pull请求的每次commit操作都是有意义的。如果你开发中需要执行多次的即时commit操作,那么请把它们放到一起再提交pull请求。 + +## 运行测试 + +``` bash +./vendor/bin/phpunit tests/Qiniu/Tests/ + +``` diff --git a/vendor/ralouphie/getallheaders/LICENSE b/vendor/qiniu/php-sdk/LICENSE similarity index 95% rename from vendor/ralouphie/getallheaders/LICENSE rename to vendor/qiniu/php-sdk/LICENSE index be5540c..ba646be 100644 --- a/vendor/ralouphie/getallheaders/LICENSE +++ b/vendor/qiniu/php-sdk/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014 Ralph Khattar +Copyright (c) 2014 Qiniu, Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/vendor/qiniu/php-sdk/README.md b/vendor/qiniu/php-sdk/README.md new file mode 100644 index 0000000..784d735 --- /dev/null +++ b/vendor/qiniu/php-sdk/README.md @@ -0,0 +1,76 @@ +# Qiniu Cloud SDK for PHP +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE) +[![Build Status](https://travis-ci.org/qiniu/php-sdk.svg)](https://travis-ci.org/qiniu/php-sdk) +[![GitHub release](https://img.shields.io/github/v/tag/qiniu/php-sdk.svg?label=release)](https://github.com/qiniu/php-sdk/releases) +[![Latest Stable Version](https://img.shields.io/packagist/v/qiniu/php-sdk.svg)](https://packagist.org/packages/qiniu/php-sdk) +[![Total Downloads](https://img.shields.io/packagist/dt/qiniu/php-sdk.svg)](https://packagist.org/packages/qiniu/php-sdk) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/qiniu/php-sdk/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/qiniu/php-sdk/?branch=master) +[![Coverage Status](https://codecov.io/gh/qiniu/php-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/qiniu/php-sdk) +[![Join Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/qiniu/php-sdk?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![@qiniu on weibo](http://img.shields.io/badge/weibo-%40qiniutek-blue.svg)](http://weibo.com/qiniutek) + + +## 安装 + +推荐使用 `composer` 进行安装。可以使用 composer.json 声明依赖,或者运行下面的命令。SDK 包已经放到这里 [`qiniu/php-sdk`][install-packagist] 。 + +```bash +$ composer require qiniu/php-sdk +``` + +## 运行环境 + +| Qiniu SDK版本 | PHP 版本 | +|:--------------------:|:-----------------------------------------------:| +| 7.x | cURL extension, 5.3 - 5.6, 7.0 - 7.4, 8.0-8.1 | +| 6.x | cURL extension, 5.2 - 5.6 | + +## 使用方法 + +### 上传 +```php +use Qiniu\Storage\UploadManager; +use Qiniu\Auth; +... + $uploadMgr = new UploadManager(); + $auth = new Auth($accessKey, $secretKey); + $token = $auth->uploadToken($bucket); + list($ret, $error) = $uploadMgr->putFile($token, 'key', 'filePath'); +... +``` + +## 测试 + +``` bash +$ ./vendor/bin/phpunit tests/Qiniu/Tests/ +``` + +## 常见问题 + +- `$error` 保留了请求响应的信息,失败情况下 `ret` 为 `none`, 将 `$error` 可以打印出来,提交给我们。 +- API 的使用 demo 可以参考 [examples](https://github.com/qiniu/php-sdk/tree/master/examples)。 + +## 代码贡献 + +详情参考[代码提交指南](https://github.com/qiniu/php-sdk/blob/master/CONTRIBUTING.md)。 + +## 贡献记录 + +- [所有贡献者](https://github.com/qiniu/php-sdk/contributors) + +## 联系我们 + +- 如果需要帮助,请提交工单(在portal右侧点击咨询和建议提交工单,或者直接向 support@qiniu.com 发送邮件) +- 如果有什么问题,可以到问答社区提问,[问答社区](https://qiniu.segmentfault.com/) +- 更详细的文档,见[官方文档站](https://developer.qiniu.com/) +- 如果发现了 bug, 欢迎提交 [issue](https://github.com/qiniu/php-sdk/issues) +- 如果有功能需求,欢迎提交 [issue](https://github.com/qiniu/php-sdk/issues) +- 如果要提交代码,欢迎提交 pull request +- 欢迎关注我们的[微信](https://www.qiniu.com/#weixin) [微博](https://weibo.com/qiniutek),及时获取动态信息。 + +## 代码许可 + +The MIT License (MIT).详情见 [License文件](https://github.com/qiniu/php-sdk/blob/master/LICENSE). + +[packagist]: http://packagist.org +[install-packagist]: https://packagist.org/packages/qiniu/php-sdk diff --git a/vendor/qiniu/php-sdk/autoload.php b/vendor/qiniu/php-sdk/autoload.php new file mode 100644 index 0000000..9efddd7 --- /dev/null +++ b/vendor/qiniu/php-sdk/autoload.php @@ -0,0 +1,19 @@ +=5.3.3", + "myclabs/php-enum": "~1.5.2 || ~1.6.6 || ~1.7.7 || ~1.8.4" + }, + "require-dev": { + "paragonie/random_compat": ">=2", + "phpunit/phpunit": "^4.8 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4", + "squizlabs/php_codesniffer": "^2.3 || ~3.6" + }, + "autoload": { + "psr-4": { + "Qiniu\\": "src/Qiniu" + }, + "files": [ + "src/Qiniu/functions.php", + "src/Qiniu/Http/Middleware/Middleware.php" + ] + } +} diff --git a/vendor/qiniu/php-sdk/examples/README.md b/vendor/qiniu/php-sdk/examples/README.md new file mode 100644 index 0000000..b7b4f98 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/README.md @@ -0,0 +1,10 @@ +# examples + +这些 examples 旨在帮助你快速了解使用七牛的 SDK。这些 demo 都是可以直接运行的, 但是在运行之前需要填上您自己的参数。 + +比如: + +* `$bucket` 需要填上您想操作的 [bucket名字](https://portal.qiniu.com/kodo/bucket)。 +* `$accessKey` 和 `$secretKey` 可以在我们的[管理后台](https://portal.qiniu.com/user/key)找到。 +* 在进行`视频转码`, `压缩文件`等异步操作时 需要使用到的队列名称也可以在我们[管理后台](https://portal.qiniu.com/dora/media-gate/pipeline)新建。 + diff --git a/vendor/qiniu/php-sdk/examples/bucket_lifecycleRule.php b/vendor/qiniu/php-sdk/examples/bucket_lifecycleRule.php new file mode 100644 index 0000000..f51524c --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/bucket_lifecycleRule.php @@ -0,0 +1,42 @@ +bucketLifecycleRule( + $bucket, + $name, + $prefix, + $delete_after_days, + $to_line_after_days, + $to_archive_after_days, + $to_deep_archive_after_days, + $to_archive_ir_after_days +); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/cdn_get_bandwidth.php b/vendor/qiniu/php-sdk/examples/cdn_get_bandwidth.php new file mode 100644 index 0000000..c9de0e6 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/cdn_get_bandwidth.php @@ -0,0 +1,41 @@ +getBandwidthData( + $domains, + $startDate, + $endDate, + $granularity +); + +if ($getBandwidthErr != null) { + var_dump($getBandwidthErr); +} else { + echo "get bandwidth data success\n"; + print_r($bandwidthData); +} diff --git a/vendor/qiniu/php-sdk/examples/cdn_get_flux.php b/vendor/qiniu/php-sdk/examples/cdn_get_flux.php new file mode 100644 index 0000000..57df808 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/cdn_get_flux.php @@ -0,0 +1,35 @@ +getFluxData($domains, $startDate, $endDate, $granularity); +if ($getFluxErr != null) { + var_dump($getFluxErr); +} else { + echo "get flux data success\n"; + print_r($fluxData); +} diff --git a/vendor/qiniu/php-sdk/examples/cdn_get_log_list.php b/vendor/qiniu/php-sdk/examples/cdn_get_log_list.php new file mode 100644 index 0000000..2b3f7dd --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/cdn_get_log_list.php @@ -0,0 +1,31 @@ +getCdnLogList($domains, $logDate); +if ($getLogErr != null) { + var_dump($getLogErr); +} else { + echo "get cdn log list success\n"; + print_r($logListData); +} diff --git a/vendor/qiniu/php-sdk/examples/cdn_get_prefetch_list.php b/vendor/qiniu/php-sdk/examples/cdn_get_prefetch_list.php new file mode 100644 index 0000000..958e5eb --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/cdn_get_prefetch_list.php @@ -0,0 +1,46 @@ +getCdnPrefetchList( + $requestId, + $urls, + $state, + $pageNo, + $pageSize, + $startTime, + $endTime +); +echo "\n====> query prefetch list: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/cdn_get_refresh_list.php b/vendor/qiniu/php-sdk/examples/cdn_get_refresh_list.php new file mode 100644 index 0000000..ad4fca2 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/cdn_get_refresh_list.php @@ -0,0 +1,48 @@ +getCdnRefreshList( + $requestId, + $isDir, + $urls, + $state, + $pageNo, + $pageSize, + $startTime, + $endTime +); +echo "\n====> query refresh list: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/cdn_refresh_urls_dirs.php b/vendor/qiniu/php-sdk/examples/cdn_refresh_urls_dirs.php new file mode 100644 index 0000000..2140378 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/cdn_refresh_urls_dirs.php @@ -0,0 +1,59 @@ +refreshUrlsAndDirs($urls, $dirs); +if ($refreshErr != null) { + var_dump($refreshErr); +} else { + echo "refresh request sent\n"; + print_r($refreshResult); +} + +//---------------------------------------- demo2 ---------------------------------------- +// 刷新文件 + +list($refreshResult, $refreshErr) = $cdnManager->refreshUrls($urls); +if ($refreshErr != null) { + var_dump($refreshErr); +} else { + echo "refresh urls request sent\n"; + print_r($refreshResult); +} + +//---------------------------------------- demo3 ---------------------------------------- +// 刷新目录 + +list($refreshResult, $refreshErr) = $cdnManager->refreshDirs($dirs); +if ($refreshErr != null) { + var_dump($refreshErr); +} else { + echo "refresh dirs request sent\n"; + print_r($refreshResult); +} diff --git a/vendor/qiniu/php-sdk/examples/cdn_timestamp_antileech.php b/vendor/qiniu/php-sdk/examples/cdn_timestamp_antileech.php new file mode 100644 index 0000000..f2d7855 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/cdn_timestamp_antileech.php @@ -0,0 +1,20 @@ +censorImage($body); +echo "\n====> Result is: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/censor_video.php b/vendor/qiniu/php-sdk/examples/censor_video.php new file mode 100644 index 0000000..7ac056f --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/censor_video.php @@ -0,0 +1,52 @@ +censorVideo($body); +echo "\n====> Result is: \n"; +if ($err !== null) { + var_dump($err); +} else { + echo "job_id is: $jobid\n"; +} + +// 查询视频审核结果 +list($ret, $err) = $argusManager->censorStatus($jobid); +echo "\n====> job status: \n"; + +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/delete_bucket.php b/vendor/qiniu/php-sdk/examples/delete_bucket.php new file mode 100644 index 0000000..325a47a --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/delete_bucket.php @@ -0,0 +1,27 @@ +deleteBucket($bucket); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/delete_bucketEvent.php b/vendor/qiniu/php-sdk/examples/delete_bucketEvent.php new file mode 100644 index 0000000..7eb744d --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/delete_bucketEvent.php @@ -0,0 +1,28 @@ +deleteBucketEvent($bucket, $name); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/delete_bucketLifecycleRule.php b/vendor/qiniu/php-sdk/examples/delete_bucketLifecycleRule.php new file mode 100644 index 0000000..2146b1b --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/delete_bucketLifecycleRule.php @@ -0,0 +1,27 @@ +deleteBucketLifecycleRule($bucket, $name); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/get_bucketEvents.php b/vendor/qiniu/php-sdk/examples/get_bucketEvents.php new file mode 100644 index 0000000..2379584 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/get_bucketEvents.php @@ -0,0 +1,26 @@ +getBucketEvents($bucket); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/get_bucketLifecycleRules.php b/vendor/qiniu/php-sdk/examples/get_bucketLifecycleRules.php new file mode 100644 index 0000000..a35feed --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/get_bucketLifecycleRules.php @@ -0,0 +1,26 @@ +getBucketLifecycleRules($bucket); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/get_bucketList.php b/vendor/qiniu/php-sdk/examples/get_bucketList.php new file mode 100644 index 0000000..6a2f7b0 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/get_bucketList.php @@ -0,0 +1,26 @@ +listbuckets($region); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/get_bucketQuota.php b/vendor/qiniu/php-sdk/examples/get_bucketQuota.php new file mode 100644 index 0000000..93474b5 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/get_bucketQuota.php @@ -0,0 +1,26 @@ +getBucketQuota($bucket); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/get_bucketinfo.php b/vendor/qiniu/php-sdk/examples/get_bucketinfo.php new file mode 100644 index 0000000..98fd9f7 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/get_bucketinfo.php @@ -0,0 +1,25 @@ +bucketInfo($bucket); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/get_bucketinfos.php b/vendor/qiniu/php-sdk/examples/get_bucketinfos.php new file mode 100644 index 0000000..5eec1d8 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/get_bucketinfos.php @@ -0,0 +1,26 @@ +bucketInfos($region); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/get_corsRules.php b/vendor/qiniu/php-sdk/examples/get_corsRules.php new file mode 100644 index 0000000..58e28be --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/get_corsRules.php @@ -0,0 +1,26 @@ +getCorsRules($bucket); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/image_url_builder.php b/vendor/qiniu/php-sdk/examples/image_url_builder.php new file mode 100644 index 0000000..20e2b00 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/image_url_builder.php @@ -0,0 +1,74 @@ + + */ +$thumbLink = $imageUrlBuilder->thumbnail($url, 1, 100, 100); + +// 函数方式调用 也可拼接多个操作参数 图片+水印 +$thumbLink2 = \Qiniu\thumbnail($url2, 1, 100, 100); +var_dump($thumbLink, $thumbLink2); + +/** + * 图片水印 + * + * @param string $url 图片链接 + * @param string $image 水印图片链接 + * @param int $dissolve 透明度 [可选] + * @param string $gravity 水印位置 [可选] + * @param int $dx 横轴边距 [可选] + * @param int $dy 纵轴边距 [可选] + * @param int $watermarkScale 自适应原图的短边比例 [可选] + * @link https://developer.qiniu.com/dora/api/1316/image-watermarking-processing-watermark + * @return string + * @author Sherlock Ren + */ +$waterLink = $imageUrlBuilder->waterImg($url, $waterImage); +// 函数调用方法 +//$waterLink = \Qiniu\waterImg($url, $waterImage); +var_dump($waterLink); + +/** + * 文字水印 + * + * @param string $url 图片链接 + * @param string $text 文字 + * @param string $font 文字字体 + * @param string $fontSize 文字字号 + * @param string $fontColor 文字颜色 [可选] + * @param int $dissolve 透明度 [可选] + * @param string $gravity 水印位置 [可选] + * @param int $dx 横轴边距 [可选] + * @param int $dy 纵轴边距 [可选] + * @link http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html#text-watermark + * @return string + * @author Sherlock Ren + */ +$textLink = $imageUrlBuilder->waterText($url, '你瞅啥', '微软雅黑', 300); +// 函数调用方法 +// $textLink = \Qiniu\waterText($url, '你瞅啥', '微软雅黑', 300); +var_dump($textLink); diff --git a/vendor/qiniu/php-sdk/examples/persistent_fop_init.php b/vendor/qiniu/php-sdk/examples/persistent_fop_init.php new file mode 100644 index 0000000..baca846 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/persistent_fop_init.php @@ -0,0 +1,18 @@ +useHTTPS=true; + +// 初始化 +$pfop = new PersistentFop($auth, $config); diff --git a/vendor/qiniu/php-sdk/examples/persistent_fop_status.php b/vendor/qiniu/php-sdk/examples/persistent_fop_status.php new file mode 100644 index 0000000..73e85a3 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/persistent_fop_status.php @@ -0,0 +1,19 @@ +status($persistentId); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/pfop_mkzip.php b/vendor/qiniu/php-sdk/examples/pfop_mkzip.php new file mode 100644 index 0000000..fb95cc2 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/pfop_mkzip.php @@ -0,0 +1,58 @@ +execute($bucket, $key, $fops, $pipeline, $notify_url, $force); + +echo "\n====> pfop mkzip result: \n"; +if ($err != null) { + var_dump($err); +} else { + echo "PersistentFop Id: $id\n"; +} + +// 查询转码的进度和状态 +list($ret, $err) = $pfop->status($id); +echo "\n====> pfop mkzip status: \n"; +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/pfop_vframe.php b/vendor/qiniu/php-sdk/examples/pfop_vframe.php new file mode 100644 index 0000000..49fd36d --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/pfop_vframe.php @@ -0,0 +1,55 @@ +useHTTPS = true; +$pfop = new PersistentFop($auth, $config); + +// 视频处理完毕后保存到空间中的名称 +$saveasKey = 'qiniu_480x360.jpg'; + +// 进行视频截帧操作 +$fops = "vframe/jpg/offset/1/w/480/h/360/rotate/90|saveas/" . + \Qiniu\base64_urlSafeEncode("$bucket:$saveasKey"); + +list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notifyUrl, $force); +echo "\n====> pfop avthumb result: \n"; +if ($err != null) { + var_dump($err); +} else { + echo "PersistentFop Id: $id\n"; +} + +// 查询转码的进度和状态 +list($ret, $err) = $pfop->status($id); +echo "\n====> pfop avthumb status: \n"; +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/pfop_video_avthumb.php b/vendor/qiniu/php-sdk/examples/pfop_video_avthumb.php new file mode 100644 index 0000000..986aa8c --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/pfop_video_avthumb.php @@ -0,0 +1,55 @@ +useHTTPS=true; + +// 视频处理完毕后保存到空间中的名称 +$saveasKey = 'qiniu_640x360.mp4'; + +$pfop = new PersistentFop($auth, $config); + +// 进行视频转码操作 +$fops = "avthumb/mp4/s/640x360/vb/1.4m|saveas/" . \Qiniu\base64_urlSafeEncode("$bucket:$saveasKey"); + +list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notifyUrl, $force); +echo "\n====> pfop avthumb result: \n"; +if ($err != null) { + var_dump($err); +} else { + echo "PersistentFop Id: $id\n"; +} + +// 查询转码的进度和状态 +list($ret, $err) = $pfop->status($id); +echo "\n====> pfop avthumb status: \n"; +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/pfop_watermark.php b/vendor/qiniu/php-sdk/examples/pfop_watermark.php new file mode 100644 index 0000000..ea3d6bc --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/pfop_watermark.php @@ -0,0 +1,59 @@ +useHTTPS=true; +$pfop = new PersistentFop($auth, $config); + +// 图片水印的源路径,也就是给视频打图片水印的图片 +$base64URL = Qiniu\base64_urlSafeEncode('http://test-2.qiniudn.com/logo.png'); + +// 视频处理完毕后保存到空间中的名称 +$saveasKey = 'qiniu_watermark.mp4'; + +// 进行视频打图片水印操作 +$fops = "avthumb/mp4/wmImage/" . $base64URL . "|saveas/" + . \Qiniu\base64_urlSafeEncode("$bucket:$saveasKey"); + +list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notifyUrl, $force); +echo "\n====> pfop avthumb result: \n"; +if ($err != null) { + var_dump($err); +} else { + echo "PersistentFop Id: $id\n"; +} + +// 查询转码的进度和状态 +list($ret, $err) = $pfop->status($id); +echo "\n====> pfop avthumb status: \n"; +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/php-logo.png b/vendor/qiniu/php-sdk/examples/php-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..77e051fe413b2754bc121876b5f986d028a8449a GIT binary patch literal 65062 zcmdqIWmBC^&@GHR1b265Z`|G8CAhmgA-K!N-Q6KrumpG5IKkcBg4@Y`>UqxlAKnjF zO-*-SQ!`aPt9#b;M5`*xpdt|>K|nyD%E?NqLqI^5{`&+F;QmRH{qIZuH89pGn`Gb;uuO? zmF?M)f`JF??$D2JiFUWMcb}80&%xXKwd*&mFJ>pFMAz(}4wuCWjowFC$C=(3ehHVm z4fZa(+xEw~J-8L$9!)>yCT6$3LAXCX`XyZ8Zk_S{!eTL;0P-(~hBMUll1ubia`YJnyl^>QkO=>Q9Vt`7F@qlBbG3_BOr?Ij84{dO(xqJXP{e zXzAR!X7P8gPmicVB~m)UF;(_hWoxFsS481Vg>*)fA~ zOab-#cj0XClE%@tOZ3L#o!XF06(T>yUF#%Fp7x!YT|w7>bH6 zD3xSgjLHdAiYSbI4umr|x@h5xP;|-W*4vZ)bENjD?Dd~}S#e+zh-!WfPb$j4e=+(# zkx!Dag_EFE$85z_q>At9*;-juC&5Cdqy)CPI+v7^g7t8^qQhdK=KC?U=c=fzY-(l( zMMWinPkcPGZ6flba({b(<(1RErunC5NT#&+GBvwU!!ksc-==sKCX4To{7}n0;A)9L zxLVIhh_*dE#^6ivA4FlayT*b9Du0w);P?nc+~`oiBdzy;vzzj!rpzFgS0v|ef6Y2W z`~AG$l@h&dR$*URTibt|hG+VGi=zt&MB^9Whe2p<^(^cz;+DW0{Y)k2-0=#`?UB0% zlI(qTrw*B~P~LmGp;~TxME&(J-t1#O(u{w8rR8}0?oS-P(@iBUmgMhATbY^@Dq1n{ z7N@I)6<7It8`cK{(E=~Wyau-NSny)s9G>hqtttsmu!8qhpboLV3U`%oxOl&zs9PC1 zy04&7nEW^&`CmhSm#c<)zNXKiZ)nuT3VCmKM)#tU)&Q%eRb0RYVT9{wncOVlD$}#}ejl>C-Kz!Q9r*pWWv|enbwTZ_nEY>} z+}h(n6^s5@-~bB$cwX+i$oU5P74Ui!+Q901yY}#)T&o`lWZm!q{;4;L^~^AcahYk~ zpxq<(FXubk*)~Uk_9-_vek6;IVK`X7Ud(s- z+JA^QB9|1J5@RaF4DK~+e;X@$5Eenn9X*>CeYXK|3WVv0ITluw>4~x3tJ51CWu&3# z5~wIuj88}?xZEJJ+f`eOvbfk|9XUd3W29t0!6qO(q~`Cs$3<@r=HeT=|An)Zc>6SN@NI~N+gVkMP$!;NqL(|^XIi@fh(w?T1%p7ZZz=G(#|i6;P@CFE>hY2+Jj6w z;zcTG^yvxV-#m#(_f5E5X)Dar_)MD0=oB9$S-X!+B_IApiGSXLJrUI(rKDo;z0-Q@ zXI1o$z|#*)NgSLs-EK1)_~KaC#WbDm7^ZqjUteASVL7znjy&S5KYYifPqJ?0G3I8B z5z$dQ>9H6HLu36agqOSlNw!mX9g4w5q8cve>h_>Mh_4IxxG82OGhwX|FToDXsk$neRw^${`^ z$;Tv=<>DsA$h|mM&o{L9%y^{`Mo@%k-7x%bSEXY}h+)ZZ#5A4*TopO8v>)dCyBt%A zG90wYLT~&p??y0h0rM=nAQwv(#?xOm6x-}=X;EtXyYysK_#_0qCR>QP!k$pj?{vUP zF?$b>MCipzh$c#ldOlgu%?&+SLtmylC7kEn_c??AGO#lIJ|xR1>EQ<90Gn4-gQ_jp z+hd|UuO7Wl4_I!e)v$OX*1i`7*1qEKJC1^QnfMM0sA2^8B3CrwJuEdeNjRby7c1;| z*KpYw?a9y|1m5c?H)4LmQpanYFj>I@abqTk;sh#6XeHJ4usV*fj!yTFt|t7u>j&CK zpy6R$&bAiQzW%b~09#;hxXf$ca#4uTS1!(qPJ z7EXQk!}3w0O5ahIN8#NVFD75Y$F{)MelZ_pW7_SauuA;0l6Q+9Gj zhPwSi;7{MHDLSWYe3EuY|9y`P7IYTl;GDLN5TdrtASEImi}aBW%6JP%jE;TUaujY( zVGO*h3O){U=~P*Kl%VLS4o-C2(cz*j5i74XmnF+9)RgZMwI*)|yBN{(;)uwk!p558`UF~8woG2)e}WO-D*de9E=q!L@rN$?Mr5h<(2Y{7CRy5$6;g}Wf zKJ#>LLJJw&*+ThrDs7Mg$1+WDTEcRw3XEZD`k&&C--s6*Fh+#%D-0-Ka`y{8h`$TL zyWT#D<(>+K1P7C1IP8ehm);s47W!8d+}%KtHC*4MzP9{JiRNI#ge>GVkdX?u*gVjd zDDqvZ(yL`7eti2xFOhRi$ifp9#b&J;_ON)1(J6S}RFZff+4StR{xs-9_3-fAOV8N~ z@4D(x_)*-V9-G}EmXwLXA|omZ!6{5|fFwv^;4zqNwqGn?9*U*Q+B6dYgq;Dzx=9JE zS~BhY)gNxd$|4?;%GeBk?iNK-U@3a`e|~ItuV95mC#%u9pLr`6;xhM z>0@rpR$gHa<+F=8aFAXo%d=r3FnFq7#Th#rU&(v3nY&apJug~PVdyYiPsAZS2?gl% zMajMq2K(1W7QjpYtdRUsopm>M8!UVQw}?qwlf7>)3!|qBQ#gGjMvpEj*ADBB=WVvR z8=o5vD(tyJ@cV{Vcr^%#^7k>S2eFm}fd+fa6a-zapKzF)9}c|Q{}1FQwGqSRbuBGn z^L-C(2aD%xYm1TEHryLNI;P)f`VSVX`0##zF;7BF)mez*E0(qJm`Cn;der}>a=tR2 z_8_j0r>)0#*?#A=?)jM4zSC(x#Eyiu&7a*214Usb1&6Mr>_(nV35an8u;XKNG+>^* zQEX`T&v{8H-g-&+%q>v>ZBG4%TK0=n3N;4)i3&%Li*@qqui{zP+)ALBXvJrh2-`8`!Gg+fo1TJ<#Bt1i z=RJIoJ_MrHyg9GK-8c7p$XfJFZw^F+k_uoQHOdr)S)HL5G*W7R5#PaFXl0htcy$|O z&F&r474b{B8u<`nD|{Rbhy(FH41;;#9p7y6Au*=28tQ*(u$(vBmhVq~{|j=Qks3WhuKua&fihM@0A;Q)Ax5$E&<3 z$d3y>20VHD2fjaxnBt^)<`Z2#JV^%#=4Xn?upuCc^|MX$%sB3raIjrm|c`4z3I0n8u;_ z31IUMKxU)w->tf%4^$D-ao$AZMhDWY$8^^H8B01u$F0B77pNk1dHH_IHoIi#dC@J3zXie}eIMrAkHir#D&)9K zj58q0d(u5~GBTCy^RYB!S)`qKWLaxE&5-hWm;yL_OB)+ib<-}G#5cW$6AI|k5W0BE zy^vt?{&ll5cLzzI6MP~fF)1mQwp*+y#dthVfI^b(Vk8M^7#UFqz8iH*c%qqp5D4ZmzJ z%YPL^zIuy9lL0qOU8r=r3f(M8;DUcwewGeo>%+p z7O}e4Y}|eygI$e&!-160I96P1OOWA`3(>)*)=AKEW)C&-*`M`97pX+?$O8)&W138;vsHfDQE zeVbUpf(4agYT%O!2Imhr7al!1<(~49udd-yXewM`{9EFFwFh3}CPR=UbHr&gmVYj{az)WtL^bV@*RH4>K9kN#sH#kf%q^+^o1 zAChy5CSa|gQB&MW_AFs&S;n)qTOI*up45)qOch^C=={K4F~OSwHVV=l%*orSFYk3x zg9@}*dWbEGV?l0)_M`4~z?!vKK6u#H8qf+1$39f9hF2=yx(Q;OI96w+3w5};kTXN6cg$gc}3z4rt7G+Bv z07S}7WF|4q`V+5=T5CnXxo_BCN$Gcv)<@#AY*GGR;$8mwn2&Vrv=%V~j^ISv0TS7Ix+%3je#0kR6ys-u7&#zv!uVT^KI%nUrdv#}>8u2mfLo3Bqx>~hH6sur znq)~z95emv`hjLU3n^jF%eRJ zsW_WNjFcKGT7R+02s*_BahqP0?MobUg!BW~V&$kqbmiWNvz?+!Lh3yg|qKMVXu_Z^1puz@gD*YTad-6e& zQu&jb)Re`U59h1l4IlHy0;@}BPX2h8pBwNl7oHguQ}J`bu8gZyvD+|=Hxdw>7)8Ft zrIj2R=vwerj0k|N9Ju5T+?uXYBtpJBam=Bd1Ac`gANI0j6=wt7_z^wK)+zk+zP6qh zSCo4)tci^JZqlXA2bt8KG*daZ2s)ihKT;E2P!0Y=B^26n$0xOD5*{-oU(j0cH-2Zv zW=GW1V^N&fkoU)-E$pfzoTNljr^+Ep^IV3Dp~lcP*WFPxtwpaa)%!@Y>l++=FuY;b zP>@H_A%)rxNG|KHxC8~IjCDQ4@HXzYmY6yA_;{tt24_(P`eKkoe6W1?9+bkLBV;fy-PhjX zNm*A{c~>92mjPr4+bw2SVrVug{Fwd{K)d%|NIA_7P?;oAl#cT7^2j2rW;= zXtk#0R%>U#t#X)n@L@fziqO>C5GrL;r#(^EEYO=vI#M~N(*^!fFqA9jQr!Hk|9sg> z!HVHLfk&i+F7OjOD6ycDkq<8Y6LCVMPhIrKp$9PMEY%nMoQx=${MPsjiD2BZq9NE} z1HCK_GYQeO1&-I=uAmDoo+WmcFHi{WJU~7u1zL`WxU}}-^UJVc3e%C%+))Ro0*30` z%JkHMG%KfQac}6i=l1*rrs=5Jo6kxYD-Cxhet!O$m6iBDv)uJSFVlsSmi_HZ|CNiKXE(zK}jd=AvmqU8dz z6N1zIY=PHcotsv+wdN8UCbp5ft7k)pWe@1x>%BCRfnrZc#{$ZI`rx!o)k%~M<jG^!+KL~L@qHr3+aMt6j z2%$ZMcHc7JgE3pY8l*iP1+sa0N%;O!zNnD8+#VZQGESz^0!Tc8`?cYM3QN5R55;d% zNY_Y~Ldlv)F^9L^2qpJX$g+Ck^&MLr!J~VBWl|*?O=dBf^?qS9Y1j4VcDT@A{ikzA+Gvy@eA4=Acu!f!1cyFpx_M|>y^c;yTKam#zRjs+nwj z9kPqX=LA$C=sXaE>5t={Jb>AiPWC4Q@{Y1|PL=%2{?dj<=LCd491SvYVwcqUc7j~H z9V@)~c$(Z{c1~u1!$^|4pnr2%B;9skJ1)G zxu2OU1-(~dB2&)+%Sy|hb`$GNwj9TqR&b?wpC#pExY;pC$BPWEX9+ohjaq2f(%z}} zfX5#nIo&B_2~YI%L~Pb_A#;8Lsn3do6^B;KVR9Jh53})l|6cs{r$hsMoGUA08`|I(T2%ktO{3U{qbFy*S=3~7n*HkFI1*W&gr zn)nuvh%TE%7x*k^K8o0(GutF6nu<@xrz4vJE?UXqw;jelSQ^>8DJrfGPq0c7@v^vT z=Kb{vD@g^rW@a!oB30h>)>BS%C2y)XJ<|2ujv6VCq6GZ?Ee}ODY~R=g zN*d4j7o?7nCn{@)MV?L0jF7i5lrVHirQQ8;sagj=>uKvrF09%gK5G%gQ)~0~pHYZ3 zN&xw?l?1+N%It=dNe8vWp&<5i>%*Pq2zL7*PCF)zGQGC;=+TYx3YVL-tAQlwhHd(` z7rF6{xecF1_#dVdui}I=>R?&Y#zCw-}2*mIqKTFa~Q~?}4f{LklR;R?kB4f6v91XHmv5ZWc9Lg z2k8xhZbP<}i38;kEW8#J4{}-w*>ArE@nUJsMIoBp7B-cmPW;&j8GfM2Wf4l)gEyYi zTve6rux(B0Ir0<^N?gYb^bmA#5>9`Sy_e_ z_3MXzI_fvt4!|+%w#Y8*VBW8o^=+gAu)1oa@)n ze`kr9Ca53#uZwlHc}&4SXVXnShI41#M-uLaEx8D1icsx7 z_cJ6MW>r z8j|b+Ywaj^>S+OyWMy6?F_r4}ZTkS88(`_76EF(Y&_Ib*Z^`kn=1%VkA(88^NEze( z$70U%IitS3qLGhHZ!|))nVNY(XtlB&ik-!nr~FQl`2$=OOc-aef(}u~oxnfO%dCaC z8Rvq+u1sy-f~7jUJ^0L*Phgi2;(876HLGCex) zy@T^=0?5ocjbkGpM5DmxNT@{0lz+UR2r~o&JSY=t-2r+jGuziH7-C+ty8){Hx8Rz1 zIx~|uR+C^x)}WTPfVGXY9yTmzwZvj3e&fy#xhxq7gr*GAM3QFA9n;YQdFyw^>LmqN+rh8&)*fVC@okMk z^IM&fP2NlB9d$@HlpIFj(YUJ}1 z@zVE`jO0o>R>ar7RqsDD*GB1U^$%-`aWs(~Oak=y5v*md)aXTgVK@`Mpw`9m-qp!e zwh%@>@G`Fcm?Lhxy%823y^* z)Yt-5KJy3Qb|#M()kR?Vh+?>x;@9N9{iykd_S2~gRUxBc__6!7z~^Obq#cOP1|!RL zSh!bKIa1=!JLQ%iAG82VwM0Ly)8YRt@4pjk+)snoFgA&iWDmLx9;Q|Ir6pTE&#k+o(PvSI zij-?v4uGJ(^IEymsN(H6aOG-a8}6-=pp^Uh_(VFDUVN>V?m879%SeZ9k#XBodO?On zv$;C;Iu=5C-akTfl{f3x8rw$hZuYY>4O*Ca?TD(!+U-hZkIhhp5<{V=v=)wutwRZ> z_E*QAT196V_M!HjkkW91r6XnD*Gf4wZcB5nN>RnOAms;Vk9{kdQZYtbkS*3E=ArDP zv_e8EA3Zyr4Tv4fr&84;*0(ksvhQf9TuEm);vaz;Pt+i-Cq)wQHgL6joCLkA$3RZD zZyuE3oV|?6uD1d?(eb+w;=~T$^_FjLb2ffD;8KOdL~_!GQhYMX)PXU4r;%EkF1a{O zT(D>wP#ls_^8L0DE|Rx*zbgM$P)drh(h93XQ&enxonDc!djhH5$l_8ceNWLn9o;TN zaLi%D|CY&ofRXvYFAA}BT0iu6gGjKZ1(cAC(a5q3nH^!5+u@W&j-_f>Yi23~P`?n2 z%4Yps5jKXJN@@1y&^>W`3qndJ8v_C0+bG@bCd-tl7WtYD$iVAW)Yb~!q6i8)TlBYg zUXGt?jrr{WE5}!S-Mo2g>eklQr+4@d7=7nXjeVu=+uK;5{m3sn9mYbzjkBh7HSK*c z)6P~bCF5w=;vd=eSQ1n zVC-{*2eofrc_w#1_rf}=*C(@xdCNZxnhI`XWc6MvfRPEQq1P_aNu@CsipEP8f{cgi zcy*nmM$YI0#(oG_=sF{Lt*OiCx|l*T*NMoBy)i?pze^_0uG=@MWm~p zm>Q}CMp{NAfs=ur+f~p!yiz;9zab}$1Iknrz8QZ{B_d97Df^-5di{LBMhYz`yl`V( z(rt;@$wZ|3Rhw?zGil6pcD$^|n=DYIlrc5C334)|kS_-!diSSu1hw`@y1vu!_<_O@ z3xSHddd;kblN*0@v@DW_)wQ^*2~1UpCf=>bF`FxK9`)?xlTOu{_SD zIb6GD$l>g(q|v3)Ch6+nEJsyZo<2${gMm=o7Q%;1G=fv1pBJ{H_vv6xW`6$m7h^7L z*X0haQJf@;KTQIYAOhXK)!=@xyJj^KxasW|m7KdT&7Mb-#-u6Buk~-@&5uHi@q}Hk z!aT}BhloN(B8My;#A%Cl$5$&%xv|9LFD2|B8J*TOy318yKr_Hud@`YMo%|1P zNadJVH*G~nZb(d;wgag@EV}J5SDgpiFuVfAcE~W2YId9>!BM?Y#V5tCR9W|v8%<~{ z7)(?1*MdoMVgTNH^^5$}r z>R)L}QNle%TmQ;0mX=xsMw8gvre{AV_~=fFtHjrbPndrA+ zuERQL61POf_rH$CC*aR(lXEk~%AwBV;S;7_cf?_4b2A;IA+Lt1Zyk)XDt{;j^pN7b^XcLH6&HX6t=#uDr* zEIl}M122C4tiU@UUs&9Up|z+~Os&G6g1Viq9G>Qsq%9HY-58cY|)$eoWGUT5FDrgiMGf{o(N(FVB~Y zktNLxEm_;0ExW~ucmh7Hcr;`oXZSoe`!LOR+^l6h=!@dn}7?}DEb zpXj~&_b=!OsV=94xa2rTf1nr|$Fr?cQ?+B*Il&jPGknfmr-Vm0M51^k2DWBg1#|M4 zs;*yRu72=6PPXp;znuD5l3OAm$Jop&C%0|=iV)^__sLieyC}ubFZ?jFHVn@z!#tbRtqocU`o9LC#Xzod zFKM)}l{QyGw?Y^=agOZ%D@@=G{@zs}%}ki&Wb4t6w^s1Z7S^9eY5J?tG1|o%%e}hV z7HANfodlmXx94*@5*V2x<2_!@{Zv?Qxnv`Zj|W4pX0}9m)<2|>ZZ>plxhvEfLk>|) zSv8ngeB)7{)V#)x%{l_Y`-D$;pU#-s`UW^Er%|BN(0jsns)TuP+4&ZN(;lEUDSO$UtN3N zl;K15b#{g~Lu62z=&mTZBuX)k+(6xGis}S5SnKP}x}I4!OXu<;#H6!QJ+Ca7L75|b z0$066a>c)~SILHG!w{y^=18&b+P;=<#@itS!H-wKh3cnS`%9~Pdn7l}IHg*dmP_*QYe*)sQ20%f5z60-5vT6%xfnmrR#xn^KUJ?>Rddme z!f~jN%V3Hsq!vFHNU0Sq{Un}VmeAOx1}rspTQ6+9pi*Sjn2{ac#9&r(sYK%SJAX9% zGMxBD?`+mv`rLAjl7GO%kj%8@bD(yf|H}Jw^PQo^lLd<>s>L%DS}Xe!y@vC9*0>Ut zD@7II#DT5tJt?~_XC{e2GCla*EPqm2jzeEMU1X`a`ov1ZRxH$IK%Jc#GTGG-3!juX zq%#7IPr$6UFhhNkp%Mjd*kNX9#Q>|B#l0RPi_eg{73wbn@~c`!_1Ax$+e!p zR}V_mRU9_}pd0b0UW>Qsv!mGvPs;g}VUl%+uBrSdNi18ZktDiu{1-DjH`$=6vAwPz zSNC-7J4*SKRMwgJmR}zkSoL=uysWt)Fm3OD#cUcHZnWE^5lkkAL6G+)7HcwdrP*R! zA|$qR0r~#_P!f#YM+TQIznpkU7+F zoVn2yt?|9Z_>jj=Wtb(KK>J$ceGLWZfA(O8G4r<+DpdEXzY_Wos^8#OKMlw_t=Kl7 ztj(NI^)`X^48^gV9gqq&PMvAZalKq^l_A!In}FV5^!lb6VVME|T``+KVCl3VwH95g z)ho5)v8FR^uB`*7`r~=Mu3>kEztfHPZKy=so#frI9S$!Ot4aMfpCV+|b!Fk10qx9e zR=B+ND)a|2kuUInEQF)U!boT6;Z5av-uHTvycRMuUIDkG~` z1gILX4YPTlt|;l7qOulCgY;QegomtEH(Tv%gPqt z{IsK|8mXzEg^E>KI17dVCTLS>M$4!S;Q%E)N(9(Y)N{(~#4pmyhp=icY2(lG6_;K9 za3al$&CgX{mp?|^;dyJSoR0UAd{{uF{wE}evhzu5#G9{7e@VZQlv#3BRyv7EDRBgH zpQ0n_{38IRU|h<|9U)JQpPwk=_`g+8=p>3v!HJ&kn&){^z;Y~TW>7Ko(v!@H^2spF zDzBfcC+%47EaY(%JWsGHRwZ>r=aPdfNv zv55QczK)8xe!qtWY>A`IrAeQy)wbNO=#+<74mG73Gd7`p#H3Ac;K>*(@ZCjmQ#@F& ze=(C&NlZPnB{Q9D{KS*?tGB9!rJirROGENncySaxMl!8W5~G2JN{Tdi<*%LDt;J&h zi$Krs$j%|jOV355ea4dQ4?KzCto|~(waj$yE4#$~POA-NDHUEEY(vR0u%RD~GVymU z7^r20@G7+;)o~;ejtvcLEomvqfkS)0)XbMfbC5#~O_!=2R7beFt)$Wr>5wADlE=+L zP=}LzaM1%snqJA9g8_*1T{KiT3E}Yi>A6Pbn9t7MoC-$r6S_pSPJS-j%vy+?t9P!g zq^bkB%Z-vIJGjR4L#(He;E@n`!rxMB$ zhTB5G_L!#=0q=3(=nJ`lk>yiTGsaK^wJkes5uUbc_MCXeqJl=pE0Ru?mA2pBXuOq3 z$8_nLIqvO%0|JBwJGU0^A*!pu~-Dv<U0o=4rDNhWfh7rH;*2+zM?RCpQF z5WWX0n#h(f26c>VGGE`2dt(}>v=h!r==>^Y-kRWbn%v=voF+bb?5njDo=iQ@f-b2# z!NdYM-WQRoWceJAqCFQO{_!${J=8;#wLq+GVLd-S9^4&L7<{dSpl<$`0wOMvK&q>? z)e&sUU-CA^N%2z6bKnwh{9tx3*zXFTD>TD9z1SCPnqKw>IIDV$S(n>Ljyo{B$T`Js zxB{daHM(RQ1>00j%ljQl21_H&X_a0iJIIla%E947B8ja~MOAN+E364j#crNc-LciwfU8GbIw*OhtfA$LQ^QMYG& z$ZMYAkl8>EbUM|vGgO`@*U235;J$Sf_9OOJ=|YEyK1^V3V|B2#?OXSCkB1p41x89< zcIr~n82Ah=)=oH)TS<y$hH8X%pJ_-*N(ECX;fOND+|me!HPx?obCZS{F=9JtVC<8moVe=ZobwYqK$= zz>%Nnu}p_jN8z{=5Gp^rp_pH6+k~m$ld5-5Opqzc=NZ3ipYjs53!gm!$Q(}T)5nlw z3Q&s5Bk1ITbenv<^WIiQ-L=OAvE4Kh%aB#%NVTWDQuOM=i)U}m>orl2 z&tFNZ?x~p0%bKFYniIIqVL1t!!)!TVL**$A)XX)Xxx?|*`*sKUn1FGa9>fZ8?X@IU z;I9^w!8(drM@1f?;$!8=xT~#MB^I>+e7=xa*Ph7s?NwRcF*Yq?O6=B%x zG@xHqq*#r5hlHw$^Q?RN-LxSy-4ew$=59yiHrRx7*W;1-oWEM~mq|`p2rzoVz$baCLPMl<#b-+3WNtmlgeX>P?z3f~h687da>C86b5=sO* zb^%Y4!vWfo1=S@#V0hL*X zMal=lK)JaJL5`u-UQ(DycWBY%|mr_&7MU#yDt*`(R8wqD3=;xhz`Er#=><)JL^bv$dLbl1i zjn$_=9Chb0lbd3SC`64m>)w~&cp937vXc~QS>%TM6f_!A>w|Or#)=qLld4*aQB`9Y zZ%;kK@kjYjw8crTNz7hnzXKx{iJY(wwlo-iZ$p=w* zFh5JX3nQv8^x=AXC;c!KaatBk*y>_HlV4NQQ%mOZEJh2rQidYWw9McdLM=SE-WQx= z8F89FZzy>IT0E#st_8`%$ftQa9%nX_Mn1mF4<)nygun!koQLxdNIaY_6sY&kX*x~t z3#LEX7QK~yooDi71yWcxF^|BeO<9ZDwOkt8>%*rv0E&C1K9VX;MF)p?6!=#Tz6P4sn%XNNePAL5&sNI>O_?;n5y;PLKkF|HqcF}f)|ez` z$JP%SEmFaViXJ<{SIIoYJryS|w#Q9EOxS0hAOc$QK9_VhCNpcyRAY;8ZYVFes_n5L z`RULBx0rT7kNnzraSEH6587$0cqpu8w!tz&^~`KbwOwsx%_wl73r70$?Q6=UsAW9} zPNsGl#AQ46aLxijO(jz2P6}TNJ$=|Q-;8ot=l{0+)-|YkUeY|H#ADlp55?eyvoJ9F ziIRWdm#|Miq=zD_spuK%xs!X@q1$Q~zjLfeXo7uIDe2TzI(5!C!yj3yI3i7JmkS$e zD)@1o@$@7RhmxOJ^#U#{ugA%72xvQwr92h1bTn?xt1z_#nEmh!!~x}-hlA<0xU63_ zDdb$WJ;~^vyJb787zdVHiSg)~p~{rd60s^46bWlsS5XqzKzXxbDw)vfVEq+mAp&!9jv=>o(qCD=6b%{zQEZu(Rvy5h9-xJ%e>^ z4idh$5Nkh~`=>U9@CkFoXRgwgza$Uu)y_yIw+q%~=(*eVR!W?aaOP+Ue>q37>2JuR zS^ODecm4hy-qN^89#O{%Qhf%dY6U@d1;YiHa*+qPDVl<*Xrf%=gN?kCZiY}@#A zX{R4$XzZ4l*Ulpzgdh`R(V*cPs+0q0Wn7EPhcPXodDO$+?73tvYIhGMQ1jL zVLjk<_{=we_HcnaIIi>oJ4TYaQ!;dwilwu?7S#tfEJ9NtrN+8?|vS((G|yn(@G zvzcr^*}b9uxc)-cJ6j@?`e;a*B+5xRw7iT@`t-gv(AjD~`)749OC4f^r1kilC3aCz zn$n0;_|mCkA&87J}+5V^ifZpeJfJpv6U@Q>^Sw= zn}HQYE-Q3dDdEKHE?Y9Vw+iz?u6|#9Rf}2RA8tpZ`Pn{%jE^(ce(jc|N0kp#qG^UE z%*+IMQD!S;%uaf@a}n+0-X(Ou`@Y>K1!A*&uQJ~IS0kI@)PZMsw^UeLOej~MSvjdV z$2_9EK`}lSCJqbK_!DG z(B1L+shx(VgUf9j< zoWshrx^|=8e!&@E)M(BiF2IBlFDu}#QGCAW|0aWLf68sBg%?wrh7W6}YJUKU6*msv z`$EYB<-Beo-N>=B{EQ@f|AW)d?&`Sr_F(u8gr$YZ4ebe)kYHSDU~r-NnHQ8K5m)RGDF|F|I7+ZLuUV zT8xne*Oh+S(N!5+Znd8e2E~`ypNa*L!$Zmdj)&H#RuwZ&=mI``)Vzc`?$AhtbNR4^ zU`KF%FS^T&o+;5777QaPYOs5TGTHYqr)|XpWxR9B`y#4-zjsvpoeb{?UIBXlSJD=C z&Xh{kL4D@jX-Ut!%^Q29OVrZ3s4 z2xu?TXrMVE5c;g49e!=|oj@&1AmIGQ z#%VPMtzM-$A|*fpjvNQMHJ90`FBxBYH!mrYaBv_<9GWmEw@!12lnb_HR|8I~tzV>s zU;P`w8=R0Ku!@Q6j!Yhc6ShkETQzdc?DDi-SItW`V;lKR8#CuudcHg1A@q5bn z!K7^bhjl|mzo$nD=WWYxa#=L*yY`^W^*IJyz6HT_!k9f93$z zJ*7vz=Ui(LzqP>-B+%@z|GTgVba~tMG8M|u`m@^@*%LNTw>3DpT$o8!U0pr&Q-3ow z$GHoyD4G0Yx49=aPrwL!i|&yG6^iDR%IzS&$5Ink1*~ag4Z5{K_Vm;`h6?wzzk)R7 z6G%5)3}!ezwCq|cH5s!g^K&S^bOX_RQ&wbSUmDGKJo(dHLv(*Wx{)0&v%Z{_?|NmW zU4iWFAfd!JS0z!Q{AFkR<6UZFJC$-~c_!2S6Q~5<)kLBG_MxV+$ll_J#$Yc#dhXIv zh-zwS6317?X*6o%udf#Ue*maJSHJ6kX0&uJ$B9GRW#6Frl!Y*oKhrF!3a*@yc+SIp zs^MdP_JYR7CahSt%y6ZojMn6dlx{@Vr9{!@f&mQ-C>Yk`@p(k%{T|MOMh1-nwuAjg zad6Kw7#le)Lcs5T;Lq{!qr33MfBXmBclTx7S`J`zY*^x!N#OY>9>nPAshqiqe8uc6 zu$9?9)b^~$YIn1OC0|%U%T==jdIu$fSXMq?UTh+Bb`EUab`m9PZHXv+wBrAiXvUa* zRLOW;T8NecX&UOvGHhz+jvbhs952oa^m#FN-n@*$j>eLPf0`9OV`pWqS_4%y8{@!w zjy1{6V`Z9JVJt0lRnNBqaddQEuTKOwD1>r%Hb_`fvkNa51|U%+M_UdcH8o@Yf(03O zop9MvmG5+Q2IlbAQuUT$)QgRxYDzFRd>SW@ypbsfM6c=A#vi`_|KRr@_&qFJ)`X_| z5Wf3^pW!3--Hzi&4@tK;)PD?p$MzV{vk6K}YH}*vG=&s#o>5)6Ag5-tt^Bzo*tl*i z3`kMfL_U3*KPq$!YXv@| z5eS6Qf9en>#`^QVv+3&FanJkThnmW;xIrm^Zr_`4a^(`RDapfdc;5>g)KX?hG0RV~ zD^yPD%%|50a0 z7pkku!3mLIMg&CEa)RcM(#`lZTVIB=Budgr6JtY&MRUtHg-R-L=X-t^t!*s=5WSk= zHvFCc^>OTcV+Vfo;}0MdDv@q}c=#mWya7n+vMO?)zirJrN7|d&`sY|ya;P-#$jXM8 zqIny$I~FZZfyx6CvS}HUSoEyGF+f>cPj})?wA8FtK6lmNx-OJzau8O zQq0a(eEuO4%?(r9M|0;=(b`)gG-qUOlasD^;L0opB3X^xpu62{WS3&q0_OS|h5 zM##6b`Jv3Yd-#8wq6LvOIx@DQRW#6%njTEjO}DR-#kOxj-z>MJIOwG6#Sq z1xr2uFqtLNgz5PTG{LQr#`?-kh3+@sJb=@udW*WjsSe|ObN-0tqfVS0;f58>VM*8@ z3LFx%IZi2=QAO-Y>e{hvSDw{Guy3PYOw8PDX(~iVUs_&=hUP`Gk17Ai8W~KJl4WqE zxaZ?M+aC&On47(zsi_Hz7B4mxg27A#LrNOabvi4Mv7kv)FJ=t5EGwS=r3p;ye8Q^r zn^9g-FQWTOxZTs+djb#q&PO;PjR=>^#Dp48_dwZrT54SAWR8ewx`#FFPbM#f_kj zmMT%ro8-0EUPUsIDC(M0#3i}x47Z?;o>Rl}b{w`=1IulEWYf%;DLb<|NEvVpFoj%i zOp&%Qi-Zxo4WYJi4*E{KVf~a`a~+aj1>wr92Bb!-_pQ056^oZF%>Yuu1S1-xAV|^c z1zdKjM@+LgsR-P{Wi{{zX54S(RgGwDnIlRACE_|F36Dt3jYeY_9vUckK=T)G6!Q~$ zB3{5{WHmFHttU9y$0>ICr+|P0Q-~%S>P*7Sq{QlL=_pzWvpr=a1;O!C){4peV3`IZOm)1-ikq zGt;$BZw&eUMf<+s zDP|V5Wh^UUHOG3_%;hYP)nt}4mOo!*Y5kp7P23V7p_$!Z0S7@{dhVSeK#>E2D5jcy zH+Z}`3ZIOXV9n>PHE)nxr%}_;iH6n%IC{`Xg6r=;j)B3`h{R~_DuwY#6eZQ|Xl`4K zeS2RM5p*&st*FDbxBUTvp>n>TakU!;lD6B-zNJDwqp*IUWdQ`#P1=}LSLg17B#?o^ z;3=4dCg!Q@so&>;p%*lxVnd$$FCS#`3ZmwaLp^Wb^X8SzSGp!~Zk@zM3;QHz&?%ub zz2tJEMtNSEj%I2jUN9kDw42DjVZ0tcbZw@>IJt@IYD!U4VN|r5n2g}S{(VIQQk+{h zPd)hyvsRjh&X!Vq@pHH0*_V!B&;C;w7@FY6k}wrNEdFK_jLA#D?>m}%qQb7JWK!%O z%}J5#STwuw7}X#QfRnp9?IRmhAn z*E!0MSzPy60#R;A80{i7`1pP3702s&%Rng@Dn)JMTp1wIe9>|~vTF>{%~I;Z%3IaRO^RVdwXx3C^uBbCsP=kn8xsER4DaRr^nI5$LQEJrlU!5 z-Mm6UThD+2-f_B4S)Yh#Dwch3B+=edk(obw?vG) z`E97IYQ(->&*9jioq5|N<+5JCc#$q>}$+X2P0e8o~q|iKKM!6 zsY}br$hSgPDYaa<;qnfwUtVKjqU_gPp;^l)*N|UBsM?E$YHp-pb!%95_0Jox4w9_r4Q2e5_xv3(r7i+BxDH*oAtHY>$p6-E^ zq=KrtF@J>Oo5UA*))D23siLwT*WdLC44gWI-V<+%hws?I*Tl$wNDQ|~W9tH3x%Gam z-E=!V-T+tL(|M6~>WC)=HZVElq#ur%31NB6t-8mNp0`Rp3&8T%Ys}k~l?1T$$_`w# zxGJN_DY)a<@g5vLe3&a*e$0B(S!1dqEMlwB`Sw$*kFrwHiM6@88RcbR;kKbBdjuNk zxtONfAet_1!&Q8YP3idguMXjv7mi>$786bLi15&HP<8L@(C3;m#pM4HjTz(~1tXzSX<`#s*A=8a0xjpH)0|AtmhEZEvhuXS2R92KD z6bcEDO@mtc*nJ#K7SF2_gVJR79~r^FKlCfSzWX>rL4W30WHU+B_>w-q_s+{RU_|GM znBw8X$8hk_K}9!tYdj8 zE5bd>mGg?l)fq4%#_-Vhet^$@_Osac=I*!k<_VXUp}M99tu5_Xv}hq#ty+bP*RRL2 zWlK=P*@w^P6W6t})Pvivn~#f@G~vI0^g3q@Lju?s2hk|MZrK162$as8D=M&A8bo_* zx!E#-Vdu`*&j~{q=s%5z9{P?LML)d007^MHmGa}Ss;WU}7ajj%EMK+)YuB#9{P}YQ zka~ryPQ!xkYJBqJ*W=p{zlYm!-k6yldEG_=eW+4s@tG^Qit_Aa-)mJ&|0*Yhz+vt>XMP-9tq_B(Lzz3=6Ud#+H{6ohi$-Iwy$AineP^WtJs z*`l2F^5-iM3S!x!7IEE49{JHvaR2=uL+{C+xA|%_@vNOXMWdHr@8`2z{4LnB6N>iRZpz3Y?s z*r&dS2mbVDxSzk?^P7KYL|?poItrB3)0|?1nW|IX@6d%Sq^D5?7wAPXm({ zI|W$rUNf6IXtb{KQa@T63`1{hd>lXg;Unh-7}?3GQz!AQZ+-)tFW-pkZ`g`QfA$17 zGz`B#S;_a_whUKqoX?LV!U1h2GM54x{2Y)nk$n7y>uQ~G*X`SXfEyo?^ZwyJd~hHB z`mg>kR$p`xe((1lz~LiDMHC)QA>Db?8r<`)4dU1mDSbxSf}%|msH+L1zOFpOj=uZQ zch3VbDs;Vj@vU!t12=8E5gRvNh95riWBzPLGS~6L@4XB+UAso)FzWi5xf+>S*1Wu; zPB!O9Qx9E|pAjIrNwTv9km#y*TNk!r$$6HJ%*{N5iw7c$?&&E&gsR~M$SDQ5_BvAcb)aX%ddhhPCO|S5INi8th(MicfN+(ZoL_|a)!9`^<9}tD!+N}X54${6(Vin%s|O# zoE8X`qqHn97nVRrMxE00NUqERKq7ZtPO}lRJjfSL9ufkhRC11%FD!DlK`aB zY5_>1As+{xV91B=_UcT8-Oimm-*$K1naGLb$MA_yd;-7vmC@lg==WgL+Bs-zsS|TX zA~w}5H`v-z%~_JckPaO>gyYAL&&uol*rPwil~-;SY$**&ciplUw{5!^v3T+f<8L(h z0wILUt7J^5M)Cu?vD|#5SprCO0dwY$>gpP>WU-Nwl;9|$o9sw5;;X~NEbt_)pK2xdtt6%*p7MnE_!=+WCm3=y(g8~}rY66*X z>sMcWbyhK?Y}vp6P5k9w{uRc@4cBFNdjnQ2=@9d?!tkQ`BcF$ZR5b#AEyIWh2M1>D z^&TA=#+`TEfyW-7NfG+M-5arH#T-mepTT`h-V$#R!EmMZ6LKMxOMc;XU3RkvkSeV% zySn;%ESSG23HdiWVMKK}=2h{Tz_gn40BDKJj>c zICf||zWP`9;H9U&&6Q|4XTO&n^2{?&;lT&LDc*-d z9xPqd#6dX7k2N6zJj%;TP+J|&7$8TE9-Z~qoBCUQ^rIie@W@!^*|_)aE8zG0M8s~< ziqoSZ6fBo17*!&y8`$7L&W9*F;=MV}*yg6@jJ0aCD~Fj3YrNML8djRl$rLpaimd1; z10(6Lb!TfRNVyaRR5STOoDHRtaXj_YuV8rK1b+F`f5!5)*Q27k5eX{1XXA#;KNU>+ z{d7P>IP626nS6Qr^l4FP;B1A$txHNuL?jfIh@xnyY?c{|#So1~IV+BfIgoffe$H>a zH}~$sAARyq@YS#UGY6y^+}UAUhdzkXQUafH(N^Qc$w3im zSXWzz#yZ3L9~>G+&pB|{(eT*BIsTkGFdB`E>rIh^bj)=9&$aZNIEMS~ z`vAW8z5nLy&yRVXwYc)~6?pXLuL&0HoFEy&A3=E!w2+Oi)i5hdoxgJci7rsPbzxU` z7pkhtOqYo{f0Qz!f%J4iPvp1bb`ag2rJU{B6WI9e6t(179vHF0MUYv3RRyPaD`kui zjr8Kkn=cry&1eJzr;eejmKyFxb2=%>)~n09tXkM%I;f$dJczm~zp0=Gv3Kv@vr@!O z%`Le4>T7VzEw^CJnl)%>s22(=y~o5#CML$wbMgeN7L`|NXg?)m3%;@DBnP$q<; zK3DR+hyEM)-TQuQ+qzYh1^UDv{V_iOg-4+CZP4H3vTSay&Xf##`K6c6iXG8$5*wo^ zu&b`#B3i4owzQ(Yu2$s8L?Y7|9Oy@1Umy1E-;Wnxd{KlppFG)XMhKo8eRlZpA>n$w z?6Qrh=Jj~y zxjkYZD1WIK&82yzAm+ExwS-_1xN_bC63rjwG~}bCvyRS=8F!s-;}$fwz9 z+ky|Ryx4!iTCB{Md_52|A2%U}LSTzcsS0TdTsyb+gOF@*z1CxsPE zWoNoLAf+Shs6*_T&L5SRSK?i_-il9u`ZJh6Pk#JVaiX!I7E6~d#+EHt;p6xJ7GjAM zzWLxc`LX{4cJF%QoB;B`zyJpTVm=!Y2>3W#4GQq}@+;odRE5fNL)rH9^q}|DsWUb{ zF4?dVfBjc~gAE(jDZl6Sc=@%i7Gw3Q<#_kI?-I+OG#xXh`!!REse2h)RFd0c88cT_5pB74XeCWI1!4H4< zBiwMqHdItpo|BvK(MNxV{hW=Yna}E#3&kmNgv*YO|Mk~*oDm?El~v$V zpZ+ulmVe8D5wZPfEQ!e}e$3<37#WN3V~>izqtQg>*s1p1M?U;PJn_WOar4c$3U+a} zGB!RT+;QpqhnNu^FO}D6sh^n}p@4?I-rnLB3%`$V;H>C-4}CWSMs&Q9X}Z>&&5umt zWd8(C4^DEXKPir%KBJOFY1z!L_k-W~I-dCXFL2l0?-tcK&Q|Ce@7cYJv!sU&Fyse* z)#c0KId_^+RR_Wgx6tZ&&ycA0Q%;5N%F0T#cXf&PWB}`_8Bn7936X=8x%A8#A+q3% zEVRLKM{d>TJjf||zzTFk&0}a;y&Xpz0~3pHde3Qdir_(Nm%#xo}#Slw;%7 z_rV_sA{mdWk44sgK!cxQxG4D(Sg*{}%@Jn+A`G7X4x6Nx5q z=)@#m+trU_y`vcCia14-m@|=*pa<2JA+$7BpsTG0bK1*L9`^Bl@e9SV;gWTDKl*?EAam+RN2js>=rG>g--n)4qx{^Cb8wD}T6T5SrD$rXKzC;Y7S3xx zb$I|Ke1B@WLjLz}eUqQZKg7R%{cC46ua=~_xo9-!ex&vt)s>~3Db6IsQpk7e44BD^ zl^5ZQU-*J>$C8XsMzL#eFJ9hp82b;M#K7Q$2)m{le8fT<8>`USQja-Z4Oq0G4UP3- zl$VC!^Lns&@k0E^w;sgTzV>ze#b5k6jvP6BR<28W&c6K5U&h^c-!9yAE0?qjH|5aS zgk^5aUYRKJm^2&X-|s@s`431r7l{f+E?lr6$7M%zM&^Ph=L_P%o@epqj>pl|z65RED^XqBEb<*R&Adz;nCM|j zq>_00r(eUVllw&pl;vx0#L7!`e&kg4q2J-FR#f@nG$@Z3(75MtszOMh=)-{Fi|Kv%ub_^p)+GyP9l6(*OBjb}1 zbaV}g{wHF>m1QM()urok^YvR%S5+dE!N2;|f5hm>h)B*aboqS#%;Z|_v=KWYFiaOT zjEsz-^;GKuw(Y~`Klgd8UAsp7JQGgfoB#d*o__8q7(Yl-jQ3N|m&hM+)-)f($<}`E z>~v}2XD>EwScX5lZW}H*cR6bKKG7xkzz5#T9h)6^``h1+qem8ASVPan3p=03vEwJP z<-E=O-ecIfaXFrN`f$#GM0O}orII2nz6sq0Kr&I-_2xGl8k_h7+^mOmRJow^Fg}(Q z>Qd|=#HJX5Ik+!&(=KHJK+7jm)|=Id9ht_r>dffT-+c$CkE_~TC8bqZyKx8BY~F#D zYqyEsm?G}Y#UeA<_0<31nMZygK3Chg7T4VT*O*JhoEu;5stTDrpeOo&ML~m~d+2Ix zeSCakK?drw%U*$3zEVvU(zX1|?kdXFlJBnW zF7)*FHA8%HxkcCblOAB`&WM;HW6>V)gWS z+D|GZT7b{k+dX+iuymsw6u~YL*4cVzLbsA>6pn(}?^EnkFSi@wBOYR5` z?8wfr+w~nWIV8zOMJOuJ*3_-y52ngSBC``Xy!Qdz^Rs`zzyH%M_~CcngP(r){rHcs zy-5e7%G%|)^*vufHUDoS9)>x0Y|IVex2$q zpYEB)p%cTxxOfE^nYbo1GBou!R1scL>gV7Xz`>*a_||{##IySb#XUjm9dCatZoT!* zy3)cz7gcwq!(e5l#bO^#n*f3U?9O}l=sh#bmo?+nSHEV#$4X`H&C68BFCI@I5{U^#j+*K+lxu>j z-Cf-aQfSz5>7{6DZcvjCsEFixw^6xC)@h)*?;_n zIQCdfE#{z*?MFWRkqpCI;5v5vm<}+t)oPwFSA0t)=MjxfR zgCz9R3Jpn3p&^+}=a1A7UdqUHn8cJi?8xc%w7FHu>n0ERrgwf3 zJFb2=>KfM|R8}o!^3XBO&&M&`*NWcGBZ$sUi7;K`vUBj3_kI)WHeZftWC~(Xw{$KN zvqx!`$xLb04eD7+smvtc_2~H{>JuT!oP1YlSvfAe@B-cFboWhTbRsN_JD7AmBqoU8(NZbaZxLd~7uDZPQTA@-lUJ-p<{pFfcM9!f^SJ zne@F(*MRblxBucX?A({pApDCD{sni$>dqi+$I#Q$qXSZ)*e}AzjOB2B`R6GI7Z>XO zmX$03($WMZYIIm>e51Oi2J6;o3JpwCXrQ5BltY?ln#asEp2Osjq1c7*a$r%46H-YG zNXoTPJbOPB>%1dFs_Q?54O?D~vdVfrtfz+QR^go= z{#R_=dJV!eGRBf!S(i$Ss47-i&Q|2hFi0}I6zfk<5^S;RI*R2=5Hp1|Q zlW6Up7S}U9_MF)kT`&{V)Q&}y@*$@3yGL6wIHrb8F1&Cn&fBsj$EmCGH8wV`15R>2 z$=OjA(x-j*o_(U!Jg@kS$BT=%Wy+lgh9c-6n2-#LV+K;2l88J(c<(baQS3d~A$|@9 z0%&Y#Sn#nfU$z`8R;cY2lamn)4NnVpM7cAS&CTQ3(fs?({KWw=hbestPjw6+!ol3< zU6`q%>rDk60lyDF;Gi@*uBx(A-`2$!UYuX=kO`1xre_S%870qYpUe)t=3Iggh2^mR zlsP1eGGS#^CDv$((3IAHlu9b1$}VY)(@BlLqTguR7(G}D4{XC$?ztnWo}A?db-*RX zt`{k@|5UO)&pq_2nq`~;Z4^STiFg#JPdtx@?*1k^PQD<3scFTzShi{lW~WDC6?uid zNVsF)k+C>KJ(luPKWeMhu*mqt1dbj%mcQZSMsLj;^_q^1hxuz3UXS+hTRarj5w4S+B-x0H|0*4{|$e0!$tMDPHrI1EP$Ix-QJ?{%mhOeet^*tsg$?(O* z6jR5MzNW#2W?gi0I*K@`kq~HiUs$kbS|m9YDk(Vw^O8BA9`4bvYN-)r$+QkoLu{S~ zjB;9+Tym*yR6Dvx1&}C;>2OmfcEn7~Pz&D?TO*yhv@u=iOs2B(3am=ER`C7m9h^d9 zZXQkb6=={(zPmd+MGh(7wQ>DM)YYlX?R58$#%PMp2#{0|EfQB~|H0EpB-C6|%ZipW z&KsWPMOSLNz>t<6AV~`v)~sG9LOJxK~Ep!V>Dr??@R*B|oCcNbZ{IORmjY(R_H zC>0!}8)8Mgy}Ji2nV&)cRhVtquulJZYBqsrY#u(30&_nuld?J{|8Ke(TA_ZXIpMUZ z0N~LT6&AA8hEw(LOG5#ySXL<{n&|is9N3??M@_2r7hZ6I1|TVP^o+shR}=fra`MI# zqwY_VJ1SI>Sg%R?B;pB-kB=?rIGdW9v1aW$%}I!$zkf^s^NDNj072MLhvaR~G$c3`lgxW)(D) zmsje2DomFPQmgCc88cO5$sggAjXleq4_V8`nXAEI?gT7L;Fa0@&LKv{sM5@f>iQMp zhv@92sPf6|vwS>xO2YT-1CEBj|Zg%*;CXi2g<8dR|LgeA7NZ4CeNr@w7#KUWpCs$)s~^M%p?4QvGGaH z7CQ4PF{a$cj>}$wphhvLBl8#;n^nh!OYch~JF+@0^xd?r=7uWqb2t(fPQpSKX~}Ke zs1|@sPDL;xr`^Wh<5?R8zXR-*?TbgV1 zYcw%FuJ&s!Fl9Qs(R#aAE)v7g`H>hgY31QWFRpmP^ zs+v={OvZRDp%4R@fxzezMWY^cgze<4naa@l=oqxN~yH0R`ZS{-0;R!7G*c@ zNT$k=^&ffeDE)mUCDahBjVzyw^NF==An{wT{b-LG0Oe77P$BrK5pd8KH;9Y(7)!O~c(9z9}b9^pS z%wf80DXABgeUi$`f@o?`8B%yQjE;`Z1s&(|mKHQOsbMv$u%oaV4dbh=Qp0s5E7aDS zzg?wJU6WR5k>IR#aA;Z_`Uk(el; zIzy94H{Z#eyx+oFRDfg=AtMdD)vHzGB`WMRuUh1i=F~<_8H12Yu^IY%vhP6?2q;c; zia}bE%v?I3m^4%409LS=W9u<;KvKN$1=9J0ImE(h`F9rAV7c)?TfjDiDyg8My27gi zQrqd%3-H93WBD@G@0gj1^X`A+ zNO<&ut>=p{BdxMfv2I9Do@&jl9N4h@em}0b;tGv%QvPT}V~3E0eN$HAZTLB*8TIPQ z5Wg_GG(b|@Old{_Dw^sjoCLF`WU88BEuxysOv(UhxBy5? z3y{cytTVq^Ra1+WmKOc_6dHDODM6(vex8ILPS5gkvO+oOe`yt5cABYqNZ+}fv3wdU zfSts!cHwf zRF(Q%sE0&^hBzQiPRE3I%S?>Za@=XPahq}ObR&@X=#~wQsHs%Tl-o~tp}VtV!8c`P zRgI9WB11(^P$=lr4e7yyhw{!JEnB_TIHf#+oV5NBUSlK3ox8`Oy+4!&PC)tQ0~ zDpBw6%O5nT*Keg(?oGQeJ|5-lFM;L;Qdd_)v=jb1;laNXHkmV;u5ly<4=8=XxqIIpy}C|VspuTKdPm{+`lNG+&G(%7PN8tM*W*D`U8Tm5 zlQ?{2VIsH9%}rRpUd`)Kfk`LdFEaR)n;{UUMUp`Sg9CYQd-J)QQKeN>ss#;+vr^C? zO67}vc-__K^XsBsqemWnTrl^Au2rj6>kZq)w%a;~gl1w+`^p`nxkLo9?8aE3nOgv) zr3XlqNxZ=L2F=N#_4)_*Fh5lW={YiMi(2PD;_OJ(gxR?D!>c4c0A`Xec=!mhSj4G)r5+JOTH^1jIR z_4Oi$ly)$N$KoQKmX-E0gzlJSKV@YgY95is6kNW26;?ErXyL$F{GJ2S)a1m1Z^|2Q zyb+;LNDu#|9q;k+DYUhn%qwI^Z02H3oq@pQ)4Js14OqXbR)5}q`qQ80o!2vlEw6js^`Z}pZnrM#XB(M<$Lro?n`X_V zDQP-KR82GJ^03dLuofL4k)_KjXrQ?^t5&ScIP9s6hF#JitSXDYG3H8s@{Xm+MtYkW z6mwAk&mI{r2Se$2avPAOapmFgg#O!TSd|O1Tu|oLfyE@pVDQcPn^d({QyI|0brYJB zc7BUg+Z#1Kv#FUm4oDG^A+wgM!;<{6V~HYkGn>Hj<|-DeuIMt_b>d0 zEGZG&DC)LRcf6r#CID*Kq8 zp2CqMM;3If%Q$PT)$%;l4BJ0AiMrZSkwc=T_M7FOFI>KSh29W58=c4S=&ZP`X97rc z9%J!@Xo`Kq>n;+51ZnL*a0rh-_UMB1g;W7a(~8s1$DV^7B1e_8Ipo(e7PgQfYKV23 zTuJB^M`0~GK%&O{j_{ScB{3DQ3Ckx-f^M$z)Z}Wx#SOZr-A<;jTo=1QIC0QY6d4y zo>&kwShaGM{xb~(9G#d(Q$rQ%>(n|U8XMo&m;XdyVn@V^Y4s0Ia27X{#V8g6MieHc zFz=ghx(w%TY!=`ai^uVW&wt^J!gVY8wYl<&%f-K`g>C<#4#7Zk+f_BU8L3Tx2;Qpo&Sc~oFHR!T8|N3wLf!(`yp3x2Ywzt1c z57)JIO$x)8-u|v#yYsH(s;sQSn$;_HgV#GSA;enKY?(2eu&U%P5UT5ZXXK9{P6(}`p$W`} zqXGcW1dONx@HMa6inrf-nOYFS*N=YuQ#|z019rpla$4_y-v>mvo6c=_|0LQ@4cHN(_n+02q1ryG>BS*I6)HiE`OUx2t@M5s{q&o9R^K@(KSMu{S2VE-3WaN}w ztev?vQxr6KP+OH5S$^_Vn@~2+XHhtW!&}DTHP zY~*_62&RD|e^`1uGDe6-mREB?N+suPLC(Ii&T9D6$4gC&L2mrg;jroHnFZx4s%vWX zSv#==L;rA8FDJJZu{DP0G-Y&3u+t12Dix<9hPS?clL#l$I(@nWpZ?S*(cRs3MmOXq zKJnLLG&rrXshD7Lz9RKTYisYo=*V#11~okvf;{Q2?h!<}aSoLf8@w`RX@q5VwRilQ zkWzM&R?sjzJF}qvBLTj(b-K{)#6%c9eWNHZ4{~;t30m~^4TyYYK8t#;mM_nwg{h~9 zK*i_Jm33$qo31x^KIneD>Xql=qwl*Gr6JY%=LR0=CSnNe(t?KDcOieDRprN9?oHGwqRbqxSqtWqM(FLy#Kx39vk)lyL z`kffY$UPA6$l3LidVcsKdWsW!+QS1uCmVgmSU)^C_z)bCK(ioa3>*u zT|vr2u3NiKuT&cy4P$J41{>Elazm{te0O)FtE)5bZPPh276jDSmWlgxdL}A#?I=_$ zrtY$|(~;6E8ToGzDh+T}UWE;OU#@uNCT!i5VOy#F7k)esJm}rh_e1*eyapB3Gm_>y45i>b36flwoZ79F3hI zP?Ai5V9ZYP#vZ7ou*DqyT!H(za~Hs2&h*PwELL0~4oFA$J;)#Wm>#}cx%MJ3I!WfT zcV-s`l=NcT*KhB45ezv43u^J_iXitAqc8V)XAy!LWc8KAXuoHM4l zC{Up5OU#JEaRClm)Rb6V6~yv}QmksJ#JbgWs4C0!g^&Sz{E4UV_uNz7vuD>C--x%| z@+Q3dws+{I-oJV9D5huQSlv=3Kv4yxU3ml2`VHq`)k?J?I1)>uyMIg_kzlE;b706U z!_LW&H*f=AqUFs-Mn*9@GMM-AQftLJO?jQpeMj$@$dT38Rid(74cUJ-4&-i*@aKT0R%-?)k|M}6UkK@qsE|iz$&W^;$d18_gOW2T- zn1@}$bx{=7q64H7mep%2Il4jvF(dxaBL!OiEg^o?^#P2y-(1Cd$Cl zc`N7mnxiU%q+HArI+V@5G5i@BqeyrHhxa^?F)S4gXkNaV8Lpjp!MOpr?OQ$Outhg=QL2 zPN+OoEJl+rYpCFc*SfuXv2LaG4#r+@w@6#Lb@PJ8z>p5E0a zwA?C6Rl`5c4QW?LM_vlwWUyXw*=71^Z||PKbT}rao!W`rT3ZT?3JobyVYf^R*HKvO z@Zp6iG}PDC=_TJ(?%kt}oFF|wzfZl<`+EDh1G13w%kZ>kJIt|1JMO=FfjBINMUSdXfTQZ&?6poN1`RfY9}Q-1Kbzr6=v|Hd~kJT!2|*PA8@ ze2d>Z`38uh#@i~1*9$)Kq{1cFET(<%_sbN5YPnWKUh@FEJN3q96~ERVlOL?7>%p&eq)+8OY=e z&e{5El$O^b7Mph6n$s{oW<054yhjSf+>>vtQ@!QMsc8;KM;CmtAAkHYeC=!Bz~6oL zZ&9nw$7yLQ5wBd<%xoB^PMyN@&pwZz-*E?C*!k?)q3FR9eC4ZO#|CZ8Hr;E#eefWr zrenBp%L=_zdH?R zIlQ3buCA`e>Q$???a;__8acsPN>%21bar*+T~V1{4?lE2zusTNr#|&btkf#`R;{QO zubiBia70}1z5Dj#?mO?qgAd++R<1XNX8-5dMs##!2iw}_K&fjc)v$V7f%a$$IJVHarPSdhWnH+u>N6l1HXJhQm%|#}_ zV+ykkv$;nHt>d_5?1;Ib33=PJTl=5;js9M7aS1Ni@dj?F=B@0=Q5p!gazVyX=AjZl zmep$`C#WIz$gu@q>_j|8Wf9A|-MXf$- zXV1R;^y_H({Q+IDlg{f&4oF_T7l%n3vz>C3^#2r6TDw}!vChoQaG+e6A_X~p%QbC5 z8aXjAG$DGM>a~&OQ``YLb?W39o!{?$?>ijSI`OV|zC$!c)AgpN_mWUZl+_dCqj^=4 zNJJdVEWhTHQ<&V3bDti1?xiEwt;zhYBK zC@J~2-Am4xD$6q?CnhJSL=VoHESlN$!yo)Ne*EJfV$-J0SkcmghK5E|R#tH1U5xou z60_VeO-@c=d~BS1?L+A8>BYpv*jc~%0)Zet_32OJ%U}Mo-t++UKnuV6!hr$YdGCH9 z8&h2D!@5;9A^}fp*Unuc_mR(9v2rCgY*3k3ES^Gl?-+buFLIj{$tlALbIxWVm`wTM z%Bm`%mq*1ekw}y~DH9kS84)r?{r&wI85w#}49+J%`DuLZtN*P3eBekQ{`)5ni!%D$ z`;Ls~ku$leVeUL-h3rUR(#>-#^dBu!hP2jvfg2kdkQRVe!APybNr&y+6G6;udh)DXc$#i|l!M#RGX%JWu8N8Z{MBFmHNN=8f6(7Md~yUoyL%U+ zamr;Cp)}w_Lv4v#{m0J-RTn1n7}-wO<$?Z;YeN*~{Ldt3WiJLe}(922iU ziBa?V@xc#$C<}~EogTvf`~Cx>KPps`KRco-MY>*75^|TB{r$5eJ4c&A*?i_RpW)te zCTw%8Z3N%{ z^{(d({9}LlaeVIcpEZEdApXDqdM+q+yqEU8Ddtiw}?} zUXV2@mJ-a34Jsfd(Pbsi9zOrzg8Eq6>@UySc%}Ex>0VcC< zcv9N-hcG(WiN}8TU9};YPMkl0S6%-B?xlG&$$JITc}J3cWljv!Fp;#xPu{o+NVBtH zbar$s`J0;>R6qLBkK(r5Zqwgu>l(-HckII0#H^UHLyTxHkrWNM>2Te?eftoP$MX6v zI?tDE->(0=Z)hUZ0BSzvE(I~_HA{(vd`Up9LZiG(=K=>1u3Nhv=bo#kZ)xNNfn_;2 z%nh2tH|5IO+LpcpvVHrd`1mJ2fp@+0?HT8zbpYS{{zGW%7(&GvfDtVkIWaP5aSGg2 zUMXBRjlx=VfE0qM#esWU>QTe@}W=$qap>v zOh`>;h|E1FUZ0O2djb#q?^pSapXmp=@UmO5cH=8B7n_BlPSB==TY-F(0kc%r8TX^C z#E<4WHCHh;J%bacPA%D+dgI28c*7gsfOoy?T{!Q&^Yr)kA05E2?mdK&u^EIo7%?St z9!g6xBg>B;JDRsb1F02k-@Z*hr~UmC*%L^a?QQ4irKBGi%4ZD@4d;C>Xtc)Vm%j=j zO5W&(+`GeV_yX_0uOfBUAyH zEx4|rNHp+{k8~lDoj;qErriMV>p7iMBdKT_ns!F>0Y^>$h=Z7z~u*$p`)m2X|*w2r4QY zarKRVDe^FknR8IgQM1mrvd&PWBu#8TYvanGOn>TO9Ew{cwwT%3jI=aV%f8YJ8r63EDat_PERw+TAE0Pxh$m4L#hKVsd?xyWK zlZv#Gp(zPf;pE{b@Z|6REo;-SeC?m3s&=_(kX7v15wjoeX80ClPqx+IIi-#_Fcvh7 zj*X+gw|hz4z*W_?!suRl=_Pp8<(K2;n{Uc8+xW;LbQ*$AV@o!2> zOEH&MKaPTreB>kgPaWM8V)&iU=ao1pcJ-f3S{<6+ud=dIY}~LRKSNqn#0~Y0SgQ%D zlBVF1lf7bcZ9`opsS3>-l-uwr#s`K3;#r4OvXIt9Kj^KY0ZA zKD<|iBF_|z($^pyp2ASCrAUM5(n%K+RA5Jo43OxFqEa5q(?lu_wVG^DnjNKQASIIu z>_^bMRvH+vi^)SIiV3Hf8@SnIYRqNUiUsK;aT;a-qap-DmFR5UgM07z5~imzVVN}> zcVOEUZ$msb3q>C&Avb8uZO?6_j|lkvJ`XogrP_5!qP4YEG|DbI@TsasO>G?->gzch zS|$t=&EdJ|;)}6qv>2@4FIl!HtBKW=DjO>&Ny;F?oIiFi^eG~4! z>n^mnyQ^x4O3U!U4}KVz?bxor_vn*HMURzFv4&}L4Fi)Aq-~5(s`>DeV2~T&>+!Rn z{hYHI_u>ZX^LocS-;MXY=RNv+M~?O3_=z4=l!f^9F4sq@cX#&)b&bWgXs#6XGS$}A zp}BdPa6C3{+<+}x&c}rpoS*esQvTR~s1tYJzZZv&b_vZsV!~$%MnYJIUyHH9HpHS? z=ZKQIZZ}9Ff3!#$61ie4W!_FrRYj)cTW3g2j6z^(R^b$ylZDury()v82H7Q;bF0_0 zhW3~wY-s(w3Pu&289j;nfBhBo_hgi{E32Dv!(0AdRNN)v)5yvl+3mAgCP;$9%oHx7 z7gbs{rbkZ9%;4a`gJ=In^ZIpx&1^4T5%Zp?aWcf2Noi>aL2i7>St0$k`nm=&+MvF^ z4t3lxH8eG1SyMAsu3X7KW0jp59*>~4V+03}4dcMkULjc%3i_Z`?OGPWE=>zbz2Y1WA^~jMelh;_U;mYZ(ockv1m%9B(Wr1L zXe>ABLK0Y0575c+A@O4;hw$46_8}aNp{c$KjrD3lLo61GdO%=04Lgp#OP}pr9oPG4Cx8Fl4?zUEodNL8wau9J#rjx`LpvxU))VM-H7Y1 zyA}rz9Y#-2H)f`1_nASu>o0kNEV z;LJ`9u{AnfBtP`4d-mYnZ`y%iz>6DhxDKy=^_60hEh$>iaKe-}#E(F{xv5E<_v)%j zecLD6NAO=idmOE&`w`&hxuSx9PMfdP-#>U(`j0NYcpGOh=VH~W)k43}UtBDVxg8)C z^WT@2kpogH_Pdk=QzhT$y4rdK0zQ}P9p+BLINCZ#vHwU1jvepCdTQK6>><65Rm8&t2M`EYid=Ut0Yq^>{1k}o2U6GYG0C!)MSmI zaF{VeUGB^jGGR_ez!B7#3&V0l!)!nZmZp1`!IXMn4>$UC_u0ec!iUi1+^advWDeSKz$!w&-D@v$dvX z=eQTFjzpiDj&ctueWSbk+XOEQG`}%qpd_7jLUW@m=|9!ab z+UqzFo+kkBY_7@am{66VQ5p2=ADlv0-NgE?%X07i=#kg|G^Xv$<-bW@#+qp5tSr^HGuyaMFMj+i@dGXKhPWCUaOy5G$1 zPgHM>JYHXMkb90HOpOm<*B^d~XCM19rpB^6zezatH8*`+u%uKfCiSwJWoJz}3RiZ- z^r^cv1h2f*r!$Aap%IJ>4=(5;zv_ys@QrVL13NC=F8zIa0;`hKe-V67e|^-X%F00u`EXlhSS~sb;Q?Z$XL*R7~^R z2ljJNj$`ZQCN$QUbEf7OxhM00Ju-w84jdkt#wpIONF!}}DkAg%Q!dkt8C+PnlIb7w zafFPsdEEENe$Iwsc;zK)1-qf~4IXXIlJS^mzi9k7jS)Y2dI*m{eH^Ddhfq}+QW+vY zkmiO8G53nr*ci$8^eyOmlf&`P|NIrfCZ+MJId#CM?0kzbeNwx|@r1a}RN5Ym@oUYm zD_!4_@mbD%C%L0Bjq!;Y?u4kLEGTk9*Ezr$BWcp5L)7eStHtqWFd805&*{D9-%tnf zqb`3<2v$(|UZj9T-;)&pCdyu2r4GxQ*9P*$!UYPeG-wlINe$re;f1lIb?Y|ZoB#4HTyjZfAaG|d_h^Tv zF%y{+MFz3xoLWwuRr=0!gEGer6eXvHapHz5ksyOLhj4UGyiZa-V)`oOD7;0Yk(H|E zlp^hjQqZOg%cYrER!>&;6(++;T5kz{4jz2s2zDRr6pf=aO|+Qkk|!PYRj)1S-%WFd zM&r7NM<(GBxg`S_G5J^#2IlT4nR=FrIatndfPU!7!#H@f8%+(B98d!Mp7LaYEd7`E zpUS#vpN2Rn(Q`#1Iyy)3IA@OmpZNRqq6)jo$^6qCG;Q~bU;45RMzjm<9GJU$M}<}% zG1zD{CM}<5LR}t02|dceC=yKwAWFmuoaO}ZhPeYmAyRT+C>KS*Oe4|hdZZQE&u(bW z8g{1eVqfP$#3EUB2_ysbNDk~Lt^rqJEiyo&yT_xw3=FAQR80w2BAM<(Qu9Zm2PrQV z1pBazye`dVU>|G@yUq8f%K~)c#-AKw97WutCUu3PA}>Ft1SZD@(AB;dNB2F9)}v2j zdP2@X&b{b5TzbVjgeWOYW2|K!wext1Yy*&eoEdqVK+ucjO=-pFDeT|3FaHb7jm6D3 z->idCn1jzBcK71>{e762hzM{Y@MHQ+CT3_B&VaxAy9{6vD^VxRD)9S?#25#WmeA-5 zOBu@8ZSsxQb7d9OWjZJ_&W1cSM{}HjNQ?0FH zzw=#Gy?5j5ZxH{c!G`xeau82GcMKz=Q`~`wi)YxWd^LS&DeXGb|B-edU2AeQii5v^WO_OjMlE>T!q$(`aYbdkg%-LgQy0KuIu~dYVkJsZ9!ly+Zuj=`wxR)26 z!Q}X94EMF8o74TC(+AMkbp$h0_6}2JO*3A5%cuCZf*g=$C1A-Uh2u8tNGeSuFZ&L0 zW4f$CWk@t{=gtSEt^okt^sNGTj7QmCm4p;-f@;n7i?I+?#h1L?(Gd+oK_ zfIDE%fezep_cNH9j&SA{123lfxJv>A}cgJI02)F*(|casHYZ?aApRU325d(Xea-;*r^` zy>ToKX6_Lm6lV@5}8PJcrv$KmIV}5y9>LJ>)Ws6?^Or_WD zJ!1%kd>R;K&a0(tUA(DeIT6-9H#SJymAzZ_`5+0?y6L?;=y+JdruH&Yih~O!V?Oqw zJz4QXK7~ETKcaLc<=v5K=2P);J)Q+r(VW}+& zwfA)GMCH8+2Z z8wC7m0UITpo04djA>%pq3mB&P(2A_oSSzhTUUzh_?=#lcZ>3Q5~vce`0% zRvku#srlJJu@|*fA$@zNPj~QpI6onQV4wsWHmuXbY)4P_V{~i^#eCbT)Y3PI1V+^R zcWnQCX68oT;xBX9#9V`n{n5fOT zfs!)#13`43K7jqt-i1>~p2i>tCB5?PEG`OB(zuC+rVSjB6y2j`5+($Pkd-xBoOQCa!kyEF`H67CfJ$BSB%oqDuidovGa*v;DslDfv&baFKSYC zelCs&{`V`WYgmPP4oZ>8gxq&#HVng6htF!XQ`&hdE%BqNPE}|K&xUd6Q2r&~t5>hV z^5xCq-!%MfV0cEKl4@`572WBu&8uVqaZaNY-J4)7rSfU#CkHJ+i^PO^H<@D~(COcd zr#O8tW<3l-}jI}y3j zdXHo!-|39JBJpwa5CE4xv{aHz>IoiiG1`tkgJ&N80gmo_h*S5x`!mR`>V#T}GpU6t z*YVdTNXBoZ*T}$W-22Nf;mz;;7nD^ts^6<9_JKL4dT(1V-+0zkBTOSFiv8;MjEzsA zyDLA%XOf3G_q=mOMHQ{li8!WaqX=;3m14$klh>)+HHg}d^*|14gUp5@vg{C+weW*k z{_R#I=e|G8nUUu~{+V4kGW`TF`^m)V=c%Tq3=P^0q=Ehcv@T!*EzOr&woKK>>*^ii z_sukXo}~{)5ULDGoH+Oh<`Pl!Z|PaSKZmVEH9#t?MGQ!k{j4#+NqS&3GCJMI$n?;T z^FykboYZV1&1}O}W_FY|N;HABtfCf)cmz+}^BwGZ@(z(R%5hQFlT;UbHL57le970n}0y=iyIynGEMNBVf zpm5HyW5+pLOXPK7o12&8(o5Cqx>zEGuKpP@eKjPN&M}}1V~+a|SJq?)ZqgyN0qzz5LC>NEWpa*2BcaUJD_BKwlAq@ z(HUmr-5Q@^2KxjPb1*=#ggMHp8ZbRRfQRn>CZ2!%=VH`@%cA~*$M}mBNa=}gbMbqJ z3|`Y7{-Vy)zl2)sk+qH;cpUft?^kf!N56w2C4|{zLDLGVc)qqeQd_ z*F_>YbU1&7?+qK)W5=ax{%CS4&W+r(=#@!V#xXca;Tl6$hDthS&p4QaqPi11%B4g= zcCMTUFfvP{u~U_vbeoDxG*ZeK^Vq)e6Gh<6)vp&L&_KRKBA(avCh=4PByrC~=g`Rk zi4-J)0Y8>9L85-bcr1b=d+!s2Finf9KJLn4GYQQxEv!WjNC8O7zDagI{d}c+9WzWu zv6t$}q#$yS(8=`Olp>T@)}z1s81DP!KjOfydu2DHagq0PH-8=Auj3j$&vy~^e?VhU zpVe4X*4p#zJy_PV1~5vnSTu(IzW%%pgr@yo zef4X^;5dQO;TT3nXS4H1X2Z(l0}5sCf~E3})N(`J8paTyY!z2Mxq#-j=<+H zGKEKt->NwH_He8sbeaX_SS2T?*pR6=I2AP7PbFctMAVI?F*oIgT<|8hc%gXE($||R z$*L-=^19wzFStmIhNlq^v`(BFz~ImX{C>}p&L4TaKB2~N>WFj_IfdbWl_NXqMqw=p zKq3}UY4%70B>{^gnliTDnB-#=N9&LcS6L;!rd$R+j1`rQXg~fe?)<^u;P`>ZasiIp zH6S{hofZ@$`?kzhMWbQ-&riOF?zZQ#thqrnGI|VpUbX=u#^gp>GA)<3GB>B zZhIFlyXJ$qp3iCC`>W{ z(H=n@n_rzY=A^MQW`k191%Q}shmjo^Sqebi=5k4&1^I^*t(Pr1uhmy_V0!bLZ^ex_ z-jvgg`i3{&ihuu)|G>GM&k;Y<=!d6YI4MSBkP`Zm4b@R)U@D1Ydw!32Y(~b8sP8D3 z67DDpgZP$A$S!CO*%3o336|)OQA$&3X2zGB)9d7VLJ}gwJaQ&!(9)a68%S^pf{^XMG`BtsjM^Sh#1@zWZjtwb5&V#G4={zH6iou{5d zU*`eY2k5!~Z4MhE;2J1E$@kxs;jHv^JXq3CANS0`{USkuphxfPr8TRaKQ7bTYmqHNyV<&gbxloyYlo;1x+037^~VjReStYduH8MVa&u510;)d5G6v3i`5%Fr7;tR~VE-mMyz@=7> zW%t#{JaX|J)D&1=g~;p#9{BZFaBTm>c5!d2hWkE$J$@GazDbSlN3_G7*8nbI*fs^^ zDUU>1*pOgYG=_nhC9jRu7LvE*|If0*cr2^>&OThp%r^{k z_?*FJGbfE8Nu52D%VOlncifqrBj)Df_SpOpjftn{;K^r?iV)u0Z+Ru^YeG3+?^YV| ze*a!Pz3YV7-(tUS$(At?W27qIlZPHcct(mPBuJTyDnn9ZM}<=FB?L&NFqJsd{2UTj z6^~6S!-|rcq>aK@j!!q!E2HeHsmMqc2TCxPh~bgDzm2`m-ep(7Kylz7ogo;-wHtI= z+g>z>&(rHW{B^|6s(TNCJ8bT;9^K*cqIXa3q!axIcexYcFwfJ%%@2 zjJRFj4s$c^aycbAgHh>_Il^QcaWXS>X4l_lw?8(c zXK?DUw2)y=3#HHJ_`DZ%>y{WGk>Bml_SU>8DN#w2IxW^T3n^U$rPw`~IpBq62x+cK zNvHzPKKf();i20FFxf1k=ua#VjEMDgX+RW4{>2aU_tcxT8|)*%D6tAM;|w{5%r; zqA47pe4^OGT+Zw=M9>meN|`JugJXj$lk;V3gik&f$y`d#q^b(;@7dd`H%UiZ-N_i`sBh2yP#IN9DOz{TS!(kk$>5s4h1IsRFiBuvjG{jJJ`m#)F{ z6^GE(wi5?;-euQwNN?scfG??m(L4%kNdZz3Ox1i;)DSEQY2h@D9SP4rQ`C@oHnKCz zvW7^zoP!9}Rn(%l^9Y`OsP3*2qGGr7o*;jNoH>tnPhA^lPiQ%Gi$Ms`$>tU_8c>ghc?LVC~CzPDQpxe zUX3|rS2Ws9X0;5=llDiMZK_Srkm&%Kj3PULS(dGLiq<*gfLv!T!KLEQb_4};j_0x5 z#8#Oi-zNPz0Z=gD6AIwOnBoa$%O(h@DCe6l8DF|!#Q1TPV4(Xj_CNo>+!jpPJ1s2PBJCent$=^A0Ec3qdT#3{WeU_#DyUdVX~w#pXS0L z?bwX=J8pis2W*&4WE|g}${1lL8Nnc}BD0xmWv86L41XXUTbFZnnsfe4#*S>y9J6On zrqgE~H4g^>gq@g?HK-^LLfUtTGYPwr0XG2?y}? zc(1U|GJAQkmt}l8CDerMLk_c%ieptib1$hCMiuhr)d@bl@*jN3L97G#ax zb{MN*n}bR@mleYjXfqpdX45m2LthYMSvuBCwhfzVJ;hP)&SpG>O@$mYo=e&BJ5|=n zK+RQoA{*>v>_xHpdnJ!3;>*U+aeHv$;KQ=967Cm39@Z;V)-6#$vSdK1A&nX=bvvms z8ZqFDsfl!j!B!m8(*A0mJ;S#ZEU7?$_i;S?@DI6XWZT({O=s9)QpUY zNh|B5BNin;Fc)n)yU?2~x$i#y&dmZzr@=~!9PGAk$$}|xRoSrbTVl51yL=TAl$R+$ zdAPGS+~11M)}6V0+^u4cazNTf)@v$MGS*FQi_r4O|=A(WK` zx#yR{WA}Uq_x$_|7#rF+5G_K=WU4$ z)qLiv&P(yW(@+zhe~d-o_m|S0e&qL27(qoJli6dPgAbj-oNmxb6-k=G{-z~R03qqpm@6FYhVxtDCV{Sm<^ zy+|p-G81BAd<+NoK7(b=0aRB9P*qWa?U&yy@<#*R$MC@aeihF>`a=W)rSSR#LaWO@ zW#Q6SW5 zh%+P~wp{#bTy)tR#P6rZ`|*bd{uB4#^;Kcgf~A$>Z!GLcn~7x9`(t*a9N;8qs$?Ss zQ(SwHm|dvQE5RW8mVKzv7yWV0S zx;qY`r_+`lQ66Ydj_hbeqv(IC1m?3EJIey3r=NNpeceN-uMMKIyqL43GQ8%dkDz(E zs>VzbNqe9EHSYPv7cf0BEGFVI#B*_AVTuq@p|2}6{KuCf9m ziF=rux~ZTlm6}JAzx>6e`7)$JsP3f*NTOs_Q4G%|Gc@VTHR~)2&}L(kQbj-$u^8Hq zKZlt~+w#sQq3XxEEy^3cnALQ-xplyU<~OIOrttJ19z|`9f{L;rLO}(M%`JHS+dq$r z>SlH46EPg$_b~4M@u$(*x(AgMGcOMEGw%`krICR)Jn*Z3#;GGua!{%eBMB%Zs$Lew z#-B-4nRR7(YBkiUlhUrCcjVuGgh$TJz(0xL-r@TCXva$gDUIi=Ho{yW~@sFGl)oY(i zqPu-Re*5#!;mHU79g*-9N-ESLwa-2JW9;8~H=elnyBxruLPbRtzfeU;qT3C45bFEX;O;BkiPV@pDt+7dy<%23Z7Z!x+y|`tq5J54fNTE z>qx8aNDliaZ@3sYzx&Ia z{d^T;BVFS26C>St`oaIg!54mq=9T9PhD6MWDiB9GfFI<*bm8`^5ektkQCt8X$r3Sx zC}~zmDwl)>bLK<#>I?Q-c$S|OBM3T-4`&Y5eikclZ7ya`VZmH{C#FD_=V7j4M>Fgw zl1Iy4Dwat&&WW`NR)p((e#GNp zbhhn5RIXV^mWG;6b7@8xMDG1bFZQC);UV*z6O-fE`P{RpDFsS`#X_;!?SgFhEQF~$rZBQWDY%3GNuJ*RB{eUGF$Rv7XmLV zSLRp<*}cR8$#GEuSkf?@FH3^U07jN)Sjmol`29gljrL=(_mtgNbt1REBVtEWi|pom z!t&H4Q`oihX%YGi1^p=HF99Y+9N78q8k#ra#&>)Po3_3-`+O(oExlREd5(F>2+Bes z6ni~lK%3$*c=t}SJ0^dDS;AI!AtXuDl583*q-f<}9@5e|5=C#T*hem1SGMfWe$t17 zwuOrdt1K|8*ifqM=2+9YF4Td$`^oaKeyRXSFFQcWJZ8zXu&O2%(Tjwn? zi>go#Gg#%$k)17Ka-dNp?1)JizGWyNtW#>?0OTy^VhxyrdjMd~5lMiPzf}OFmkC2+nVW$g90DX7%gwZsyS$p)seIE{jPUdX`n!*ague~z z$)yo?2#Y6oWL%_5Zc!u;hi7r(_+gZlf&&p}NPf<6Xy6*<=d`%z{9FS5KnSnA_Wii= z?OzlM4psxH2$5DA)<=0>0Y+j%pEXI&j22HSfUEicHn}59i8GUfg*?Kgl}&Z^?k)sIVqnUT_|dJ`GxE<&x<|_DV3?T zbM#GgDThpTm5&1w$;yun+hWcEs4Cq~E2bI##rP!CKDC+Or19gYPM$!3#!CANR$m#OcplNey_MW)J#6k9WH%GIWa*w#Vkyn$aBq0 zv8Rwjdbt6TQ2~uW@g zz-Y1FaI{~$<$%@oG+~Z_ zlJ&KUB+I4ba%=oCB3ueQUO&A4ApfUl>03TV1ZmzbQc_?@FRzdt({nv3rcH}w=|OKw zmRPFUb&i?6cI{2)AM1*9ZSx3waX0E)c|d_H1H z9(XlCl6ml?eC+f4aqh*}=|d8!GS46I>%|QON<~863E6TtSt1LvhE&Ixp8ey^A4vG&JvcnwqMS^>Btvtzby2kgI zL*d7ZXDy40Jlx6gVtR5A!+j?(Hy7nj%+dxWA$?`dH`5!#1wi`KE$^S|W=N(q)#((= z=$`2vin(>b)8kphACyEag7EaH-N%meSHH_HO=wJNF)yNj6l2Jmz&klPj+yBQ{J|1# zlsy8Jd|tKEj@gte)Bj3Bl_;;M$M{$;|2$_DzJNL|Tv7C}opnfd4&}#|Nvh0HsKVsM zdI}`^sxl!~CJlk9_ko8yBvDL`^2%VNX^Y*0Q%bJa^#JSsU6k2fP;4EpHWL=X5 zSa`WHB*t{3kp5?S+O^{FfH6svApue>HiOw&+cD)saF+lIF9Gj|0CURxW+W29$nX$~ zIiC1@#F9KH;=rVW3Ul;&y@3*yA$d87(F9+e9jRsCdaf?TvU`o-)OVD*#_l~q%-OfM zV*-*cX@VB7w^)Sh2!N^Ny{l~(Vv%VPlFYh?itNA4e#8=U`U@)+H4#f@I)JSA6dPP| z7?b`-ao+iU(oC(HnPK#IALfo7~nCP2H#G{CYrT0+;?&F5Ti#%LsJZQ^sutXvu04cz2gO?i!ueV5)Z+nUq zDTp(@x{?1|t1=Sc#90yrONC^R!VI0Urqge@4hooUEG$!;!X%Bbb|EgO(dF`LG@S(| zlbj`%2}SetBB9-AWYR!wj4`^D%{MUH=%bmB>P+WvR#G$rp4Afb>!XB&zmG&Ly)YQJA8SG*Bce&dkP8 zkTH!%XE`8E$-au3VckYejA@{>6acARb}oko`$Qa%fXGLccAO>A14mp(DmW_Q=QI;W z4Yv?@`Mn--Gl&LRMbSotKufeMGI}Br;Ff6C<&@l);F@h^oje&u`7|GAN1;%)KH4M} zox%7}HwP;w&WHIPO66>Fm|@}tv#=jCXj|of9JGd*^qU+$YyAdAd68_TwkyfG1ixQ0 zp*aF0VoHh}mY2*TMlCtwk^&&T904ggXDCz6Hf)v$n#mnkGMdD;W@pAZAW1{NRM61r zvOBX_9ID>A0Fp(ioGR^ldsWQ!Qk5Nr-#i|bAu0CHR7x9IW;D!2T7{kBQA9MuqN8RG zA+cP7NleN>>_#bM*bK87xnQAH8KB|}F;r2*|Krm?)7AC@=I3J~v}ua0$EIRa>yu_l+}vzC&yVT?L`dsX`J%wR*Bh#f}Hwo}4_IJ87nY3qD zN*0iwUFV%bb%9_7#)rGn-M%|Z0Y!-OvU#BnLJiekpH~AWPiFAuVt<&ZRU%j_vxk)q zm#3iO@M5#pKgrF&jVKvG1%@!R>}hnBXHmm^_DXTS$PxmiOxv&BS zxeUl-rd&?Cq=G63>DVZYo4(hcf8=&dkN08o1=pjjvX0+-b4bm_O={09Z-Zw1f#np~ zVbY03_Q1n(t-U)-AXFqO=jh%c7Swj^NgO};5N0N_`}>F;fjcn4V1R#?sSXW)&CO{| z>x?b>*cLf3fk2t;bUFc242AX510)I;&CSmlLIX~8pV>d4TI`(iM>gfBZXOK*QhW(r zuY~OEL}F^iI<17aw7eE&6?GUN z>9nx&X>MST?SBv_k34~V>B z43}gb@urd0)UZbnRV=z7Kw3)qBO^mf!I1l70+1rYG!e7$7Lj6ikvc{qjVjEP2NCm+ ziV!GKqZ5fl91q-k2j74X*WBCu|Nx3VOAo>!Ngk}LRH-=^mQE;y-2c9&3qz?-p>8#?K;2#xC$%RZpVss+fY@z z0)EOXq|~8>j2|qM3>kC_&nd1UN>~dr6bBzHXYff^Miz;NR$@Owo{IxDor_3#3e%H) zn3)*F)c63VCI<6>x|d1jT{8XxIKJU+{rW{b!PL*b8-r1nQUVea-6h=@05_wfcO16%dG*Qd4{Yj>Fk;ggHGWJNAycs9J zS?qE_(o?5_Y*sN!EEY?rhE&ZlB{L%4&WaLP1xhkW-Pze`-1*CY!$ZHngB$2AsB2t{ zPN-Hlnd95p1f=tc7{VNAW+sO)%NY;>52@it!xLHvj!8#d z*b^-3+3^ZTG9AJj8S28Wr|v|{+O0x$J{q0n>}p2*mvWMHU-AB)D&)rlPE4W(Tl=*35M*FDeg!mG={`P2tlz3)!3EJW(<%B*>Q%Hh)3)I$;maN zN`UARyI%7!m8grNjz~n5zmw*rq8SjqV1!9RVB*7y2)9_nT4Ol8|0(|WPwCGn86%&c za!xgajAXHY1is~j*a-a&7)`(eBfs!%=L**QpgMxuj$cMnc zNH9__)UG47AS?^boIsxDrScy(nNYmbo3AqG|)EEk~eFAfR=?&BauKt|_-O3bNPAPrdR zXbg`KtxamWdQ7O?&xv_eR9HcMVJUu|=jLO=(W3sTdH$TlL+3&$Z7PF(n+ zYwa%%p|Z9`fG(BH2SZf?h$-PuY?y{$(o^Z<$JMgtLJV{t!suXohGm+zM|Tfxv%Yyf zR&TlzbxmtkU`#E>QU{98WG z6Fs~(#yjB>{#t4)Wnq2f*-uVjbTo{rnvkyglLag+Tj@a2lH6Vrz)L@c+{mt2y&jvl zT*i%3HNue?H|Qf69qAK-r6gXPNW?f3ONzgx+)HWIopo1~UHkXx?uMa;4(Sp^V(9M9 zAtj|#8it0UyBkEhyG6RYq`N~Ac)0H0t9Xw8_gd$i%;VtF`|I{lc?qyuUp0r$^|+@-x_=N$|HWL z!8!uO^!?Pu7#?AyCW{4eXIPjAC(UX`bq315;GuBYk@0+=)|X+>JlFqN?s2-xENuN8 zn4v*Y9QhP|bp|KVcCR#6;Tb=%-rFFtuEy2XLW$|K!BG4GA{B2u?Jm$srETbr&YbO( zn6vXyi%m7XzO*}Ma{i|MR3G0a^ghcm1VVHNS$EUmK2HC6WZ>k$@+<7@Um`aP6v{~y zhkU(SdQ4Lw(ShOQj)XoUMJnw5{2@1^{)niOeW7vV{@X>H^>z_eCvtb|`6pGQ4J>^F z;vo^1p(K!M%))8WUg*q@$kP(X8=w7pBcZLW0njiS6;mnS3$%?M+Dr94SihMRb|Gtz zdAwMKjLD?e-ap~K%C@i)@0f{)f$ykF_GkX63QxbGeE3O5GCe&06xN%ZA@#Z`f1NV` za2izhPdid+)CiWYWYrI;lYLVxz5l!LzV|`AEKs0X%XJwMNEz*48O{sq@ho7NLBV&#<;A*+5X@ z7Nr&L1LHF54oFMb)bI5c?Ey)yB*3c*h}H9X_DFSp*#dp4n50ZN@CwUuXbvmu<&lkI z4(~~0z50aiyo%D}U&ew4#GB>~lLSlw-E?(gD5DP;%qc9miPyQ&`8grEX}0oj2Ro2p ze4yY0kdUZ0++wUdGuhwdEAh9-ER$f-=QGc?+?-bJC{;sMsWogi2g($RyZ2xQl)T?P z>bPUz#rg~R#v6M3oLY3-`bWEw5r`cD%)3HbU4p&cnU>!OrcA#r0^acxHmy@{~ed2W;Yx0bAiRvWX4 zfsdO${L1ytFyGN0sldA;=KuoQIGN}Cf>)0#Z}jnxisDvL-krL3+O;M`!os=8H3E_a zpD@#FgHUl4bR2^p2($8=oe^ojqqG`{a0{2Y+Wf-Fu8AvEGK;7hr|Mt=wWlb{B7VX~ zT|kTpEk0Vz=MGt~yqLHZWb{sQp;U(@vQmd%_Lf~9JNnTP5bZ6saP>~I44WIl7Blfg zMu5YNd1@G!*Ya{ep>^yLrA9G4>Wu^hR(Asc1_gdAwh#WW5sY}y2qh2;X^0|&k|ab= zr{Kh=c}Ej{fuYLNBA?E^^e@dPqn3=ufpdu<$RqCWx>j$N#kRffz*xlCKy$O@J`Q0H zx(c5iwVg-t9If-Y7vpMacGk|u>?_;S!KFqL=4-=EtI0~v2JND1+>q0f-DN=SpT7X` zIRub@_)RoMWms&Y94d3U(x=t$9da1HDOUT@`p1R~p!0Nt%7StRO}3Z^YH`buq^w~p zlxL0Zg6$dN*J^^Nj)zlAQ40iYZNkcQZp`Q0~M!K;f@PBukOwprVd zCV_L^4AE+iR7{7U%En6wx!aWoXBKo1{SZ38x`+i3_)&&^7b*Ip@HB(njaVb{CUF&> zwSAW$u>G_99U)HvxCnmq+e5Fl-DRVLEjH@eA6u%e!U zc%%8Kr9bGwV(;OXsF^hBo-tWlS^aF$QMHPMBBv`yC&zS=SlPGEe<@XWje&L755M(_ zw|@KSv9F#_KtebJjy?_Fu!dkkL^d{Ll7bZ2_Ok8n3cC3t?AE8&xfp`BLu%DYx4V6V z&{lg1(lujGqd3k-|HzDbjJ6)v5()ia09T0)MT+ZaMAx+(kSDxYwE9vqh*bLs{l(0; zNBn*jQ0obQTCD}sKCNs*t)}J|min{+0^&46Nbw?9p20C*9jG5R6^BQ5CUoAS`Ej+R z!p=TK)`%wvCJx_t5Gl{i{hgjZ*Ccxnje9z|V~*vLxVYid6Lp3cd(%QN z2nst4@2YzW`-gWnlg9h+c?w4Zw=Tn-K4LJP?$26&zWK|Uw(D1CWi>pG@v>HoAb{6hMgXHJ;wKrPD z4!#9r98^S75_V$J*49$6&DM8g8K*EG8yW2t)EBtTVQtq$ zoO^WTpI&eG9ITxn<>w^!7XW;Pow69gk<#(j_#6IM4WNlv45Z+Tg- zu`G>#$(;YONr~MPQrzE9PoI_$Z#2C=Yv_`<{D`TAAqy0}9TMd}1>6+vwO? zA2o6^dvh&zt4_$=I)sm>5vEi6CCAkc%aSufkUqhwLFU({W05 z?vy|z6~DUvZZ~MLi5V7!`4D!#SBZi1CtUR(aHylT89?WG0p62-P2(?iCdM>$CNS>_ z`-H~PtMM;GnWvG1kiVb4T!oFIpk)1RYfGzik1oj-`ul4?SgUlwNoW4XTIR2>t+IFR zO^jc{cYTkMgYJx~-mTE&Y{LEEnsf5cP_K+fw`gdd$XS_+sAtAz%{J#vsapE}H%CGU zxNd3cCZ#GpZ60eG(duO(i#g|c`hsyq_zAJXX_{)^LqcNLbd6dOX4pTVVm$SsIZwEawr4aiEW%qR;7jM&K*n637}0#W;%whs!#! zB?oJbo7)=ef7`soPCDAxWRR+pOUq``}PdD>h={y z*3!D4B#t%OHSoU=8DDP0Vqk=9XL_z9j%DodaCuNN$oRJEu#q7ZGMz7938s^umNrzf zmbsVR6mB}jZjhr)dc4Se5C+W()4|vNpdS*Z;}BCj2F$sSW%8DyhK(p$toYg={&Wk& zOPm?H_gc16D|yyrm;N|0#A)ST4102-UlET5Sp{h|O|Lhvx;V&Ts~(}bT$UGyeqYXo zPeJbygr?XY-X^1VR4BX4R7%jgHZ9wbG?aDru{;Rwy@L5CJB_L4C0lVrys7SEtEYQW ze${eu7Pg+OdPZ+G1MtEH&#JAl}93iW4Q z(*?GsT0^hjCn|_e?q6cBjM%wwlR$fZCF%W?0=i*gEq4!5C*Vjnf%;X;*g3k%D-u?CIq zvFF=X0O+r(_XZeD5dNA4264#w_R1Nrk!K4aj7y=gWsja2%Nb4MS97%quSP%@_gh|@ z$D+8Jm|L6_pUVjf%MP587bPk)4vHG8GP_P73T@digSnLzK99ckcRxl&rIOxL^#0XY z1E49#5JJ_G1BB?nlJKTeX3mWr*^b}dQnD#|GJ$hmfZK^|^V|OOw5wGOb-ytA+8ZzV z>OIr#=B`d?vL^TR$st*NQfOl@D(Zf!xd*VrD_iu;**rwVQ%+`rX4xhc!psaxGHV*) zPh!-yGSeC-Om7I$;`9e z%x!(8ZN_aD@PMtM?vdO&hc0uxme{i5<dGI7=Ogq4FZv^@gp0X5pC^e+ zE6^R2*vF&4I2tH?j#G6(>pHZo`Vo>!e`>$g=`gBqMX;dm0GQ0NXBaZ>Kq6byRs%$Z ze0|06|8w?&Lve_SKd|6F-RuUB+T`JR793Z^kp$|v@kqkUq6ObUV}|PV+j}rpw3vXg z%f7OD5krMEXQA3{KM=$8{ds1ovOBomJ+~$TMlE+lyu_W{whi_xbO)|;i9dee^6JBi zEq^Oi+EIdXCC?y~(jVZ+nUAKSyn=$t3Ntbr${Ty$;MVBy*TyU}$6@PTiVFVCgbTSL z{?fy{RtY*46_?7U*gzT)d=EGGt6bt;A&$wcVAaRcPX;jZxADAT$U0Al*MC^{#5I z5m^QsI%1=a`kcF3u;C^5iNZOR~O;IwhHCy`K~fJav3hibCCb0OSRpZr#KF`V9b_&{^WR;zgxm zh>v2Y1=Tve^$t?aHB}}6J6Jvp#hm$ zgr3avqoe_gqpqP>!ucf5(^z*KUU8Zx`V#G7F;hiSx>_4Bb))KnN}fx4Ucc*PNCn#p z%D%$5R1$yd^Et4bkA@y4`;|Ko^_M|(GV?SRZXz*>N?luHD=W6}*2wD+!^UjCe;EEP z4G#pn!SNV2DQfe=RFMM1s%SU`MPPtdwe$1*gbJ*U?-EhnWVRV)yvZUO-^@Ss4+pu% zZK7jSxqka4b)w&UicN(7JMBj&(T|R6f#Zi_{G>Z%hpycsr<Rrs2iy>lD%0y69q57klGDYnB6uhKSyVL zkSOYx1h&_g^ZOMKBCPkrah#k=aAP)}htWh-S!oycn6zI&5Q|4ZS&EW{a{TR4@To!c zrFN%UwQJ{Z^&_XkgUWkkQYg&{tE2*JI7BE~r6^T)#1N%A)7U!gZ}sXwN6loJ-wVkV zTL*%oH9_Z$?;Lp5!Z;5dj4eb7-15rbt_&pKgPdB8?}pT)Pn)`J5b0Sk?$c0E8$J&3 zxzlT5Z(G87F@#DdsMtRo9ox5EQS{A1%T&&{GTh4B4>>QDh)qF$s0T9+o8-~@_ij5!O4Fq^$!f#{-L$|s{qgC&; zN`lIaYhtjj^;Xu}&QbSaIVxbdKk7B+J=Q4GY_>A24-5&=(k7GVNG;nCG!G7K%F0nk zLp5_qS<)7Eol)qGiH{ZI&M1R&K@zx8o?ktC=x!(4H4EMkWZxF;Xwi=LwD zECgaVeB@d`(2kN?cxv$HADM<0OjFWkE|%yd2$b@j4H$&deAh7vAhx`X#ddd&|>O|wGiZL32dBot>kn_kvgB;eCgo*haabM*OdTBK1ETL(`^`z7Oha`LH*LTDu;_~edDivg2`p6R^KaY z;+81VYbOTb96cj;qbzo@{%3t+&$BVc=sZ4?;-ixck12|+pazSD? z7YJ}*+*vI|wF)T?jJ(^((4f+X1p)^CMA)pn3c5x%J#4-N>7$cnsYEH*gMu8<4(zxK zzbNmU`>RcCKO&JknYCr#?_h*`36cv@n~(5a>FE8RKSj^&<|-X&n1S)swV{cYOMUMx z>etLyJgZk`>hL^PpV3Gf95ff|WU!hIh9?LatCb*e2GB%}a+iYk&62LPlkoaxRwacn zl@Ug78KaqUtZ4J=Hr3X}8*{H--vOl_G?Txp16PkG{-Fu89Y@!Zb+A??4|TDHQ6J`( z_o(l3L@{XLDJ)P~&xTi`&;-M-F&<|RgyowAr04bY2r5N9M)}ohHr93RLqi$sk(!e0 z>eNWckIV-L?1DM(00g0-IYFP(F@lHV)HCgbpB+gB5*$ zqlipML^VQVQn)h0d=Qq*C>ZxS zr9z2-try?g@EMq{ zR8BbkT?R}~VH9eeIs*NMqcJ_kfg6VJK{7AdC|!)h2^G2|W|EW3!yEA!Xy?%U*BLa$ zh12{Mx_~P0nWd62EHFjC$GcnukkgzcLou_+Xs9YhUir!iU<0}Kp}=SetBR#mcXeg` zc2gsYo%O>2>%}h#I%Wwzj>4?{cF)%cjKS~}AGu!IUO0cmCrx-9qTFiPeaF;#2kQL- zn}~P7xHS7fI`4hI<+)srBRFM$`RK4ZqUew5JAiuJ%ga_Br*$Dv{E(~JOC{~L(mj3X8 zEe0o!7b?B>eiPh5In67*1j72#CvH_Kn^WROq$`jR+}J(^YYh*MxZBkPf4XeX!i|@I z6az=|68s1vtP)VuwG_RLdM^xN25equC*-#3W@ao>}M@B>dX`&pA9owwyLuqVnIP{E5`S! zSngjx9I$;(xg%4=l`$)d9--{HpN#MO8gO?h=Tp*iNP>Z#T@b_4l#g8!Nr0XHwAOqySy=|L8Fd(I?LWt(if485DxuS!^nR6fUr!R>yuJ5(0BcFw!v>shbW0OB@ zA*xTCPsaT#(@W8Y>fJQDcS^rUG129_Czw*ol1g&bq3(o|cCFZP(yl!~=J>^^1Rc|5 z03U$F-~59bq*zu6RaWjFa;wRoHUp}Z;JOCV6(cIkezdHuyn+6SWNyy5SnHuOJI2rq zGb&!(zHblx-DpGX!em=;r*2h^EYWB_Swg?Z#2g~iUsv^-;qvWtj-=;puzHzrdi?r^xbAW&v(wxm zf)#m$k}cYj_f=9}E*1wn#~WF#d4=l~Fa?m65_guBQ@yu}(D#=Pl8~LgQ)hqj25(v; z0>Lt}UU7H7(N)B`Nke4mK#8Kf)?bn)^)&I1I>SF}8?8xFVpM~zp7t`3&uQ4?{cxK> zkXV(U`e3ivEo4C9nCny(gSvV}P4!pA08abXq9=iZ-m21yaO1?niZ|n@RqpM^J29NjP*Ihv1a&SVc~f-vq2y{Mx_^a9B%X^j*}11R=fPcOhSD246Vk|qg| z)NGjv{`OYJA89M#3XH-zi5m9jK7)jc-SH=vG|Au7hzC}Npf6otoYaaWp$6F-ZHDr7 zgos4k?QZ%(=`&B01_8vuXFeml_)Z&2mq7=M3r??R{s-09^G@gaWLutYSLEcPSHf;N zKGC84b*d>*j1GV+J@+e3iKra3eSmg4i%oPS(TTl4iu|U1ZKnJ9zwOhSE|jm`*La#b zVZb~k!cq7soO2Y^-S-O>Qn;?nLKuEb4zV)=MYNExmb}fa&^(J|$;};nB{tJ|mkBV~ z(w;BDK%{NQF|*m&y{$e!WkU3G`MzW^IKCmHzVaFbcEESJwU|nNf6@juyflWDK#;+Q zaROh`q?GvS=r9BTmBcyObn8wo>GfodNeMEhtE$W3UA=PrvBK;)qH}A}TRE?*f|2wQ zf- zu_n2?Q>oMf;^v3D9tF#jF6sxHvW?oQY+--OeIx3;TGlaLV#OA7D~vxeBrtkO3{$Yr zq0uTMb4;TLWBsd0KGynadB}aq+9rL>1Q6vHUEcDf?7p3FxQb?^3ItmTJJo!WaQQsH zp~Z)X$3HY!jD)e4c$yN?M?ec;Lo~4CjFDqFQYttMsix=7K=4-g*o={v+zmRB)u@wA zIn}64UD|1^u+x_xOpb_$KAjH1j1s>!3*sb7hT-64o=s&?DKg;K+KniuD_T*jk9}|- zmZqaccu3?Nz9fiJ+O?2Y*ew0@r3oI$rfEkafr`ES88=qB-!H(8d8w`i&Gt-@0 zE&(tS&LUCmXLJLtgWX72&1kzR5q>V>w3Kt2k2;VUaoH|d+#faJOX~M!v7O`(P4wwj zm$-rStTiRKVRZ$rXMXV8R#^+GTg=P%H;-WZ;*KW)4{|?DkIpLxb&m%h&_nfK47FAD zfi5#futfP}+XbqCECJ$zNE$-E@{&r>BO}lD&pxB8{Wni4^7VnWBd$lHe z5;Qq^o5H5+BNDom^`bfd76Xel=HxrsQJwj<#`QakCtfdD=DfZ(^mwf}s z=+mySE82W{zhzB@O|yo*82AGt^Pe!UkCDe>Z~en^9gJ$V4;@?ote-km0?4IhkUy@J zd*u%DhxEHehG>QL1ND&z@YIEpU?~&SqGJDW5>m-2+!k|wXm?w1@60WRE_o~2QRDmw zx;=cDS%Jgb4icaW8ol=S$6u{IJ;Ee-yF3-f2>19r$=|6dXFVyM(r4>m{@zG}O#G{H zrIlKySkM|&xmUYE$^VLZC*RiYo;>O#PMFP+t`sT9LIel=I&7pVpH5B{d|d}SjfZVW zJsF@T5;5`F9ycx$Gjf?^?P)Gf&-r6sr7c;G{^%D0!khGjkxmy3LE6y*MxF11Sv-7yM!z{pGA1qsGt4aqU8pjt44#^TpaN|i)?|#dQr3!Ktute+f z$X%T{7$n)?pkw#|*tV8r$NRw+p=wHni+pI?E+9 zIkL#8wY;PA1-tOk;ZZ2tw@;N#v*8cqZN%v=tki$kCqfBh8Fw~6n+;kLj{ zEFvl5EvNGMU)Y@@HBc-roj};80HNBEZDlC3iZ8DiYvYqS$}nD4(VqX_%Jml zwVig&={+pa4}V`#(F$y2LaiW3Hr?eII(WwI@T1O&8tA5oAE#u!?9Zf0;o->jJ;T_R2_J?Tya0@B2+CHfMZ zFf)so)uxtmlD!&X`-AQW8|4m@c3XV=br<9ufN2%(dT1#(b0tu(?IOp??G2q%$cZSE z6u5JcKRT37^R;0a>#W~fxG~vE+q+N1LIs_6CP&whIlu^?4*n^zbSs2InKX!BvaVM^v!Db2 zft}3KH0%5#H6F%%^$#z}sq{PZmUC7Y2v0o>a)#52{+e_?oRJeO6L9l+`Sq!&*3AZ? zzW^p{9ppb}_qc`1bNI;Ulr(6jk>Z3;>n&Zus`}fdo8z_eI=G?PKi7_H?dw z`A96%{6N-wjpW&*3{3`m0^rgGcgLw_WQrd?KyHQ93sEFj<`_L`rbs_vqB_QY5z1H^ zL4rjoX0D@dFBM2aaZ-rEm^Nk^H5XKOQLeaCRjKo3x>-P4S~q|&K3;56qypIU^K-G8 zDJazc4SSj3$5iGDlJCxP0mXb}X!!YjAyXKQR}Q=&})Ck4^WFasoi{z*k3dik^abL(#zhS8K`>-D2`N^v)MC(}cfg44S! z4-Sbm`$LS)1jV)QVjvK?_3qa`22Aq0w`!g3QkgXg~V?d!g>e3y>`f48YLPeiE+gD`_@!u#dmb1Bz)z)RFy$9JC3sS zMP_j&ZLKw9uY-(JKQY1#n)K=H(d1l}Wn}ejTEcnpf!t`8Yo!Wgm+^DCjG7oV|w z1OC9jKO9DmX@!k0ZX-qYi6)Gt4Uab|Tft_p2Zt+P8lbZmY45x*gp1b0c>m~YN z2Fgee+MG)UDQ3kfn7EdvmS7^g-YWxtYsL5J!0P?O(=m$T5+ziBz5PM< z6R=Ef9}mwF%Y<0quR`yTD&~=pFA3$lc3xj8AOL;Qu@&(oQyWSHuPnMg-adI264H?y zh-&v4_J~L;ZNPP*Um>%y_F0Ig+w7s2nF~i3)faGeTUr9iVM+@6G1(9(Bf``u|301h zAgO9h82#3A*MmZ=0)2J(Ed;0QB1;86@Q(h;o{i(TVYXEpbut-CYr1@dwPIOA4O}B^ zO@)mrprQ4@8VN-FW)`uVMp03D1?-B>h7TBIS|rh4MT~uw#(|J2nZEhomiEQOl)heo z4;yVc`ned{9Fb8m815h;+_1lpl4ScrBKfX3Sp>xijb-A|&;vTiH|A(@KJSs?HG$75 z#gd43QAYZ3m^|;&8lL>qt_VJp=OIU4CT&wOkhPu(8uB#cir=a;p~X8Ly;H6t=9^5T zAHewM(*|oc+tQ^aB<2iQl{n*ppOwMl5U8%I2BFti8HAaddA)iPN3Wn*%U%sXg{5@1 zo9<0YEAazrk}FPi7oN*C}<7Y|(mcRf83;vNN(y?AJ=MVzivIa!1BO*Be zu`g#2J$O*H{DUEb9twF#n6I&@4gSbstS}4;BIRCYk*cDIR>mTl;=FB?^cE5&m2Gbm z;9p0aP~ca8V*iw4+G8F1*&{At$2pxmi%Vvg8t{hI$#2J?IMC0IpAgEcupQe?^&~Ew zIICSoJX|=yYlUi$_OytR*OR!vH-fOjj=RY2uPyMAPFPVfMndJ%d$|_Ohnu*Rg={j3 z*wmB_t&KxLXBg1JOvNF?!wb_V06rr;{BAX@TS3&qHU65Ytb{WIe!w?pI7ul!DdIRW z6b!b$0SkHeB?uPBPj7@+6bdsTxa zBrQJof1A-lO_Ot9>uQ8q76V>M-0}orSeLp(HZ(YRGSQ$p$^%EHjCUTC>{hC|q7C6_ z7R(LYg0OX?z?)1f*fZSw8qSV!kQU^W2peeAd&bFIEy4&=VCDGT#rg8bz;v#C#jII} zACJZ&+~oQUWn;|Q7ep2^5dP5r>4y=fBMlv5r`}l*0c?$^n7d*+>7mWzH76iB^SVuT zrcVMaM2njq6;W%Y2s_&|@SRcEr1vjj9>=&Yh)!v|{^IAqnupFTTy+*cxeXTwC%j)v zc5)zY<7jblAzj0`RJmnIc~PRlFl+f1n3`u-NjEc?hwfLN8#kIJw&cNWOG+Mw!R<~G z%8v%Z=*q*4J41|@;rmrBV$=k{f_2ScTxGWiP>{X{MWX6s#)fMwW#`~<1LrgEqi`~4 z2QNAlDrTSihVJ$4uQES>gYyC+6xRyPeayg6GLM=@IJ-H8EJ|6qw_&Yipo{7+j;2-z zkW8nX5anbuOoGp%&8$HbqbOZ({rvZi&&3;LN}ojFFC3r}VVDV_ zOubr;+@zUVtEo%l)Q@VI-%z?@LHHV-vUE|UeuGMWDH={*|1=VT@t*LjuZG?%9c!H+1|xsxqZZ)#Yq;; zPYl%@?!zsT_gZbm;!;Dx54j>oJx#k(JaF6wKUN*~kx9_>`9O;=)WY$6Fx>BF^RgBIu`oaP!V%D4FQ6H#K_pFK@Nvpb+B^*GBT4qa0)1=Vsq_; zWaO1$6BzRaWSxw!W1R2}J*PM^v2LqhM5nV^bYy4*vR42xtKLyMGV-m)GyBKHlqe^x z?AGQ*oJ?DBFGyd7AdBsT!k5I7ZWlD0t}s?uFAAC;fi_`25ew~3V+9INpQcw8*!rL2 z0Jp?J;Sy;XdBU}qY){Wq{$wJLVH^^6&q6n0@70U9qAAJ*9rqxv>Z}%2HAy}PAui=> zzs>b((`~%F@6c)0jL$fg!NRv@+!Y@$XNs50+*~h5o?7?qnN45Z=5LK;lxC?4TBT@ox9)PSMIU{yug#>RhXPhBHmXZfIQ|2VFIsRe&4U)o1&zaP8b+Fh9kzAn5pQQjdxQOVzo=scF8dujPSk!5GM3UgwM2sck!j!AxioqOm3?b{*Qwi*ZF8vyyrFPWpPXbc{+mt-iC~_CriO^pl1yLy%Tbxbx2}B%& z@N9bs;!{AFrxP(Pkb{z}jX-KYcD@mU)o)LJ0{Ov%4BjX;DM0hl^c+S&oF~h|Gb>I0 zJJCrX#dR+@>nCo4ati&)2Bw^Kk@V6a%AY->? zz*J?$kcjQsj-fu|J+wW_1xtSnUnQ7wG zd(hB$qGv8s4BU9)0oA}lCOSoM>#c(YRf zO`-<59qqqh=y<8Ocqmr!T{sUXt4-Dz;s^<`Un1_nx#^r8oP?{9HP-YOMJIu1o#dPclM4nMXE+q1IA6A~PrL&@uJ! zsUt5@+WcM4WzQ(wT|wJ;5qM+EUC|*c9>AqRE|rl#N3jkGflF&(O`}E=CqM!; zj(YxP<84O=G&+eSN@}?+47%oKVex1)l$F0UFPgMzAfXhN8Hn++C&0S&#j*vg0uATH zK$+R5fzQG*PFMesBatOME9MbyYvVx0-LdsIwPQ?`QRYn8mS%z$#6m1#>%ngmkD`(fOqlJTU9R;InY&u^0lBVXZ`2($4y!38A_eDnP5VebW| zsv1imBeNF~|4oAUxc-9AQ@txm9X4N4bp$|ub1r{h%I^X7w`BToBgq6OcHC*DfyKFW`A#bGLGv+~DH@fiSVa&BgqJw@jfQSJ z3hhfpp&|b8pDaYK4LadcRzGttT3ZePV_;rDPG`g;2roKBSRxS$4W;Ayii+CPH(-si zwSbOii$mv*3AlvlJ@mC9M4yup$bme=uZI;VA(bp<;BE7B$jaOqS9+ zlFka2%}4-Ar*U++Iaiyt+e#p-Qv2losD1Kt{`J7A%5770RLU(1zo zG;ZPkc07kY(zD*s)6oItK$V=P6DaZ?0zneQtKKlezMvJd4_5sR%zFP=fIw8a_wW=x zeknv?96ug)s&E*AbmuMUhDc8KeOW>qpCV8#O*ys52fX`QjvuWM|0trUFtK+3;-NuB zm6J_`5(ydxr}Mru8b8f{a5dR`K0sLcQkZ`9M=^SYZ-W~ZH4;%?miye`w+oC$#cnV! zRID?&_%1j@`FMM%tqOq1beyDwN)r{em4K`_&jM7#Z7rls4E>)WrFA0U{bz|#y8koa z`!~HC=zT^0vrszVe}*dez6t)f5B@idjt=#ICMWy<^I$xfH07zV1J|^#W3$C NC#5X;17sTf{{R#))Y1R| literal 0 HcmV?d00001 diff --git a/vendor/qiniu/php-sdk/examples/prefop.php b/vendor/qiniu/php-sdk/examples/prefop.php new file mode 100644 index 0000000..1b8950a --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/prefop.php @@ -0,0 +1,27 @@ +useHTTPS=true; + +$pfop = new PersistentFop($auth, $config); + +$id = "z2.01z201c4oyre6q1hgy00murnel0002nh"; + +// 查询持久化处理的进度和状态 +list($ret, $err) = $pfop->status($id); +echo "\n====> pfop avthumb status: \n"; +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/put_bucketAccessMode.php b/vendor/qiniu/php-sdk/examples/put_bucketAccessMode.php new file mode 100644 index 0000000..638ae3c --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/put_bucketAccessMode.php @@ -0,0 +1,27 @@ +putBucketAccessMode($bucket, $private); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/put_bucketAccessStyleMode.php b/vendor/qiniu/php-sdk/examples/put_bucketAccessStyleMode.php new file mode 100644 index 0000000..3cc2aec --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/put_bucketAccessStyleMode.php @@ -0,0 +1,27 @@ +putBucketAccessStyleMode($bucket, $mode); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/put_bucketEvent.php b/vendor/qiniu/php-sdk/examples/put_bucketEvent.php new file mode 100644 index 0000000..f3c830d --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/put_bucketEvent.php @@ -0,0 +1,32 @@ +putBucketEvent($bucket, $name, $prefix, $suffix, $event, $callbackURL); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/put_bucketMaxAge.php b/vendor/qiniu/php-sdk/examples/put_bucketMaxAge.php new file mode 100644 index 0000000..4890174 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/put_bucketMaxAge.php @@ -0,0 +1,27 @@ +putBucketMaxAge($bucket, $maxAge); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/put_bucketQuota.php b/vendor/qiniu/php-sdk/examples/put_bucketQuota.php new file mode 100644 index 0000000..b00ec48 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/put_bucketQuota.php @@ -0,0 +1,29 @@ +putBucketQuota($bucket, $size, $count); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/put_referAntiLeech.php b/vendor/qiniu/php-sdk/examples/put_referAntiLeech.php new file mode 100644 index 0000000..7d56d1e --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/put_referAntiLeech.php @@ -0,0 +1,30 @@ +putReferAntiLeech($bucket, $mode, $norefer, $pattern); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/qetag.php b/vendor/qiniu/php-sdk/examples/qetag.php new file mode 100644 index 0000000..1fe90d1 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/qetag.php @@ -0,0 +1,14 @@ +useHTTPS = true; // 接口是否使用 HTTPS 协议 + +$bucketManager = new BucketManager($auth, $config); + +// 异步第三方资源抓取 +// 参考文档:https://developer.qiniu.com/kodo/api/4097/asynch-fetch + +// 需要抓取的文件 URL +$url = 'http://devtools.qiniu.com/qiniu.png'; + +//回调 URL(需要可以公网访问,并能够相应 200 OK) +$callbackurl = "http://your.domain.com/upload_verify_callback.php"; + +// 回调Body +$callbackbody = '{"key":"$(key)","hash":"$(etag)","w":"$(imageInfo.width)","h":"$(imageInfo.height)"}'; + + +//---------------------------------------- demo1 ---------------------------------------- +// 指定抓取的文件保存到七牛云空间中的名称 + +$key = time() . '.png'; +list($ret, $err) = $bucketManager->asynchFetch($url, $bucket, null, $key, null, null, $callbackurl, $callbackbody); +echo "=====> asynch fetch $url to bucket: $bucket key: $key\n"; +if ($err !== null) { + var_dump($err); +} else { + $id = $ret['id']; + echo "id is: $id\n"; +} + +//---------------------------------------- demo2 ---------------------------------------- +// 不指定 key 时,以文件内容的 hash 作为文件名 + +$key = null; +list($ret, $err) = $bucketManager->asynchFetch($url, $bucket, null, $key, null, null, $callbackurl, $callbackbody); +echo "=====> asynch fetch $url to bucket: $bucket key: $(etag)\n"; +if ($err !== null) { + var_dump($err); +} else { + $id = $ret['id']; + echo "id is: $id\n"; +} + +// 查询异步抓取的进度和状态 + +// 华东:z0,华北:z1,华南:z2,北美:na0,东南亚:as0 +$zone = 'z2'; + +sleep(10); // 由于异步抓取需要耗时,等待 10 秒后再查询状态 +list($ret, $err) = $bucketManager->asynchFetchStatus($zone, $id); +echo "\n====> asynch fetch status: \n"; +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_batch_change_mime.php b/vendor/qiniu/php-sdk/examples/rs_batch_change_mime.php new file mode 100644 index 0000000..c5bd6b4 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_batch_change_mime.php @@ -0,0 +1,32 @@ + 'video/x-mp4', + 'qiniu.png' => 'image/x-png', + 'qiniu.jpg' => 'image/x-jpg' +); + +$ops = $bucketManager->buildBatchChangeMime($bucket, $keyMimePairs); +list($ret, $err) = $bucketManager->batch($ops); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_batch_change_type.php b/vendor/qiniu/php-sdk/examples/rs_batch_change_type.php new file mode 100644 index 0000000..a19d0d4 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_batch_change_type.php @@ -0,0 +1,45 @@ +batch($ops); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_batch_copy.php b/vendor/qiniu/php-sdk/examples/rs_batch_copy.php new file mode 100644 index 0000000..66c4d4d --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_batch_copy.php @@ -0,0 +1,40 @@ +buildBatchCopy($srcBucket, $keyPairs, $destBucket, true); +list($ret, $err) = $bucketManager->batch($ops); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_batch_delete.php b/vendor/qiniu/php-sdk/examples/rs_batch_delete.php new file mode 100644 index 0000000..ebcdbe6 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_batch_delete.php @@ -0,0 +1,32 @@ +buildBatchDelete($bucket, $keys); +list($ret, $err) = $bucketManager->batch($ops); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_batch_delete_after_days.php b/vendor/qiniu/php-sdk/examples/rs_batch_delete_after_days.php new file mode 100644 index 0000000..928dd14 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_batch_delete_after_days.php @@ -0,0 +1,39 @@ +buildBatchDeleteAfterDays($bucket, $keyDayPairs); +list($ret, $err) = $bucketManager->batch($ops); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_batch_move.php b/vendor/qiniu/php-sdk/examples/rs_batch_move.php new file mode 100644 index 0000000..01d8c91 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_batch_move.php @@ -0,0 +1,40 @@ +buildBatchMove($srcBucket, $keyPairs, $destBucket, true); +list($ret, $err) = $bucketManager->batch($ops); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_batch_restore_ar.php b/vendor/qiniu/php-sdk/examples/rs_batch_restore_ar.php new file mode 100644 index 0000000..b2f79d0 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_batch_restore_ar.php @@ -0,0 +1,41 @@ +batch($ops); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_batch_stat.php b/vendor/qiniu/php-sdk/examples/rs_batch_stat.php new file mode 100644 index 0000000..88bc32e --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_batch_stat.php @@ -0,0 +1,32 @@ +buildBatchStat($bucket, $keys); +list($ret, $err) = $bucketManager->batch($ops); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_bucket_domains.php b/vendor/qiniu/php-sdk/examples/rs_bucket_domains.php new file mode 100644 index 0000000..3cc9cb3 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_bucket_domains.php @@ -0,0 +1,26 @@ +domains($bucket); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_buckets.php b/vendor/qiniu/php-sdk/examples/rs_buckets.php new file mode 100644 index 0000000..84263a9 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_buckets.php @@ -0,0 +1,25 @@ +buckets(true); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_change_mime.php b/vendor/qiniu/php-sdk/examples/rs_change_mime.php new file mode 100644 index 0000000..f4442aa --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_change_mime.php @@ -0,0 +1,29 @@ +changeMime($bucket, $key, $newMime); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_change_status.php b/vendor/qiniu/php-sdk/examples/rs_change_status.php new file mode 100644 index 0000000..bedf61c --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_change_status.php @@ -0,0 +1,29 @@ +changeStatus($bucket, $key, $status); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_change_type.php b/vendor/qiniu/php-sdk/examples/rs_change_type.php new file mode 100644 index 0000000..8b3201f --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_change_type.php @@ -0,0 +1,36 @@ +changeType($bucket, $key, $fileType); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_copy.php b/vendor/qiniu/php-sdk/examples/rs_copy.php new file mode 100644 index 0000000..aae4d96 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_copy.php @@ -0,0 +1,33 @@ +copy($srcBucket, $srcKey, $destBucket, $destKey, true); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_delete.php b/vendor/qiniu/php-sdk/examples/rs_delete.php new file mode 100644 index 0000000..ad97266 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_delete.php @@ -0,0 +1,27 @@ +delete($bucket, $key); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_delete_after_days.php b/vendor/qiniu/php-sdk/examples/rs_delete_after_days.php new file mode 100644 index 0000000..96e55de --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_delete_after_days.php @@ -0,0 +1,26 @@ +deleteAfterDays($bucket, $key, $days); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_download_urls.php b/vendor/qiniu/php-sdk/examples/rs_download_urls.php new file mode 100644 index 0000000..e803ddc --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_download_urls.php @@ -0,0 +1,19 @@ +/,一定要带访问协议,也就是 http:// 或者 https:// +$baseUrl = 'http://if-pri.qiniudn.com/qiniu.png?imageView2/1/h/500'; + +// 对链接进行签名,参考文档:https://developer.qiniu.com/kodo/manual/1656/download-private +$signedUrl = $auth->privateDownloadUrl($baseUrl); + +echo $signedUrl; diff --git a/vendor/qiniu/php-sdk/examples/rs_fetch.php b/vendor/qiniu/php-sdk/examples/rs_fetch.php new file mode 100644 index 0000000..5c1a5ab --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_fetch.php @@ -0,0 +1,43 @@ +fetch($url, $bucket, $key); +echo "=====> fetch $url to bucket: $bucket key: $key\n"; +if ($err !== null) { + var_dump($err); +} else { + print_r($ret); +} + +//---------------------------------------- demo2 ---------------------------------------- +// 不指定 key 时,以文件内容的 hash 作为文件名 + +$key = null; +list($ret, $err) = $bucketManager->fetch($url, $bucket, $key); +echo "=====> fetch $url to bucket: $bucket key: $(etag)\n"; +if ($err !== null) { + var_dump($err); +} else { + print_r($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_move.php b/vendor/qiniu/php-sdk/examples/rs_move.php new file mode 100644 index 0000000..a399665 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_move.php @@ -0,0 +1,29 @@ +move($srcBucket, $srcKey, $destBucket, $destKey, true); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_prefetch.php b/vendor/qiniu/php-sdk/examples/rs_prefetch.php new file mode 100644 index 0000000..28af115 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_prefetch.php @@ -0,0 +1,25 @@ +prefetch($bucket, $key); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_restore.php b/vendor/qiniu/php-sdk/examples/rs_restore.php new file mode 100644 index 0000000..a3bf070 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_restore.php @@ -0,0 +1,28 @@ +restoreAr($bucket, $key, 1); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_stat.php b/vendor/qiniu/php-sdk/examples/rs_stat.php new file mode 100644 index 0000000..36e863e --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_stat.php @@ -0,0 +1,28 @@ +stat($bucket, $key); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rsf_list_bucket.php b/vendor/qiniu/php-sdk/examples/rsf_list_bucket.php new file mode 100644 index 0000000..97a5838 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rsf_list_bucket.php @@ -0,0 +1,47 @@ +listFiles($bucket, $prefix, $marker, $limit, $delimiter); + if ($err !== null) { + echo "\n====> list file err: \n"; + var_dump($err); + } else { + $marker = null; + if (array_key_exists('marker', $ret)) { + $marker = $ret['marker']; + } + echo "Marker: $marker\n"; + echo "\nList Items====>\n"; + //var_dump($ret['items']); + print('items count:' . count($ret['items']) . "\n"); + if (array_key_exists('commonPrefixes', $ret)) { + print_r($ret['commonPrefixes']); + } + } +} while (!empty($marker)); diff --git a/vendor/qiniu/php-sdk/examples/rsf_list_files.php b/vendor/qiniu/php-sdk/examples/rsf_list_files.php new file mode 100644 index 0000000..31c455b --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rsf_list_files.php @@ -0,0 +1,39 @@ +listFiles($bucket, $prefix, $marker, $limit, $delimiter); +if ($err !== null) { + echo "\n====> list file err: \n"; + var_dump($err); +} else { + if (array_key_exists('marker', $ret)) { + echo "Marker:" . $ret["marker"] . "\n"; + } + echo "\nList Iterms====>\n"; +} diff --git a/vendor/qiniu/php-sdk/examples/rsf_v2list_bucket.php b/vendor/qiniu/php-sdk/examples/rsf_v2list_bucket.php new file mode 100644 index 0000000..5f9d763 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rsf_v2list_bucket.php @@ -0,0 +1,34 @@ +listFilesv2($bucket, $prefix, $marker, $limit, $delimiter, true); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rtc/README.md b/vendor/qiniu/php-sdk/examples/rtc/README.md new file mode 100644 index 0000000..c7fff4d --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/README.md @@ -0,0 +1,34 @@ +# Rtc Streaming Cloud Server-Side Library For PHP + +## Features + +- RoomToken 签发 + - [x] 生成 RoomToken: client->appToken() + +- App 管理 + - [x] 创建应用: client->createApp() + - [x] 获取应用配置信息: client->getApp() + - [x] 更新应用配置信息: client->updateApp() + - [x] 删除应用: client->deleteApp() + +- 房间管理 + - [x] 列举房间下的所有用户: client->listUser() + - [x] 指定一个用户踢出房间: client->kickUser() + - [x] 停止一个房间的合流转推: client->stopMerge() + - [x] 获取当前所有活跃的房间: client->listActiveRooms() + +## Demo +- RoomToken 签发 + - [生成 RoomToken](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_create_roomToken.php) + +- App 管理 + - [创建应用](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_createApp.php) + - [获取应用配置信息](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_getApp.php) + - [更新应用配置信息](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_updateApp.php) + - [删除应用](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_deleteApp.php) + +- 房间管理 + - [列举房间下的所有用户](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_rooms_listUser.php) + - [指定一个用户踢出房间](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_rooms_kickUser.php) + - [停止一个房间的合流转推](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_rooms_stopMerge.php) + - [获取当前所有活跃的房间](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_rooms_listActiveRooms.php) \ No newline at end of file diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_createApp.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_createApp.php new file mode 100644 index 0000000..039eadd --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_createApp.php @@ -0,0 +1,32 @@ +createApp($hub, $title, $maxUsers); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Create Successfully: \n"; + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_create_roomToken.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_create_roomToken.php new file mode 100644 index 0000000..6a62aa2 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_create_roomToken.php @@ -0,0 +1,34 @@ +appToken($appId, $roomName, $userId, $expireAt, $permission); +echo "\n====> Create RoomToken Successfully: \n"; +var_dump($RoomToken); diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_deleteApp.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_deleteApp.php new file mode 100644 index 0000000..68bff33 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_deleteApp.php @@ -0,0 +1,25 @@ +deleteApp($appId); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Delete $appId Successfully \n"; +} diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_getApp.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_getApp.php new file mode 100644 index 0000000..9f8e374 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_getApp.php @@ -0,0 +1,26 @@ +getApp($appId); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> $appId Conf: \n"; + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_kickUser.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_kickUser.php new file mode 100644 index 0000000..019c3f2 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_kickUser.php @@ -0,0 +1,31 @@ +kickUser($appId, $roomName, $userId); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Kick User $userId Successfully \n"; +} diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_listActiveRooms.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_listActiveRooms.php new file mode 100644 index 0000000..16e6027 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_listActiveRooms.php @@ -0,0 +1,35 @@ +listActiveRooms($appId, $prefix, $offset, $limit); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Active Rooms:\n"; + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_listUser.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_listUser.php new file mode 100644 index 0000000..a839728 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_listUser.php @@ -0,0 +1,29 @@ +listUser($appId, $roomName); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> User List: \n"; + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_stopMerge.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_stopMerge.php new file mode 100644 index 0000000..e140907 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_stopMerge.php @@ -0,0 +1,28 @@ +stopMerge($appId, $roomName); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Stop Merge Successfully \n"; +} diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_updateApp.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_updateApp.php new file mode 100644 index 0000000..f771075 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_updateApp.php @@ -0,0 +1,40 @@ +updateApp($appId, $hub, $title, $maxUsers, false, $mergePublishRtmp); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Update $appId Conf Successfully: \n"; + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/saveas.php b/vendor/qiniu/php-sdk/examples/saveas.php new file mode 100644 index 0000000..5d51ef4 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/saveas.php @@ -0,0 +1,33 @@ +为生成缩略图的文件名 +$entry = ':'; + +// 生成的值 +$encodedEntryURI = \Qiniu\base64_urlSafeEncode($entry); + +// 使用 SecretKey 对新的下载 URL 进行 HMAC1-SHA1 签名 +$newurl = "78re52.com1.z0.glb.clouddn.com/resource/Ship.jpg?imageView2/2/w/200/h/200|saveas/" . $encodedEntryURI; + +$sign = hash_hmac("sha1", $newurl, $secretKey, true); + +// 对签名进行 URL 安全的 Base64 编码 +$encodedSign = \Qiniu\base64_urlSafeEncode($sign); + +// 最终得到的完整下载 URL +$finalURL = "http://" . $newurl . "/sign/" . $accessKey . ":" . $encodedSign; + +$callbackBody = file_get_contents("$finalURL"); + +echo $callbackBody; diff --git a/vendor/qiniu/php-sdk/examples/sms/README.md b/vendor/qiniu/php-sdk/examples/sms/README.md new file mode 100644 index 0000000..8c80a38 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/README.md @@ -0,0 +1,45 @@ +# SMS Server-Side Library For PHP + +## Features + +- 签名管理 + - [x] 创建签名: client->createSignature() + - [x] 列出签名: client->checkSignature() + - [x] 查询单个签名: client->checkSingleSignature() + - [x] 编辑签名: client->updateSignature() + - [x] 删除签名: client->deleteSignature() + +- 模板管理 + - [x] 创建模板: client->createTemplate() + - [x] 列出模板: client->queryTemplate() + - [x] 查询单个模板: client->querySingleTemplate() + - [x] 编辑模板: client->updateTemplate() + - [x] 删除模板: client->deleteTemplate() + +- 发送短信 + - [x] 发送短信: client->sendMessage() + +- 查询发送记录 + - [x] 查询发送记录: client->querySendSms() + +## Demo + +- 签名管理 + - [创建签名](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_create_signature.php) + - [列出签名](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_query_signature.php) + - [查询单个签名](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_query_single_signature.php) + - [编辑签名](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_edit_signature.php) + - [删除签名](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_delete_signature.php) + +- 模板管理 + - [创建模板](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_create_template.php) + - [列出模板](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_query_template.php) + - [查询单个模板](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_query_single_template.php) + - [编辑模板](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_edit_template.php) + - [删除模板](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_delete_template.php) + +- 发送短信 + - [发送短信](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_send_message.php) + +- 查询发送记录 + - [查询发送记录](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_query_send_sms.php) diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_create_signature.php b/vendor/qiniu/php-sdk/examples/sms/sms_create_signature.php new file mode 100644 index 0000000..ea1f158 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_create_signature.php @@ -0,0 +1,29 @@ +createSignature($signature, $source, $pics); + +echo "\n====> create signature result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_create_template.php b/vendor/qiniu/php-sdk/examples/sms/sms_create_template.php new file mode 100644 index 0000000..3cb3874 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_create_template.php @@ -0,0 +1,33 @@ +createTemplate($name, $template, $type, $description, $signature_id); + +echo "\n====> create signature result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_delete_signature.php b/vendor/qiniu/php-sdk/examples/sms/sms_delete_signature.php new file mode 100644 index 0000000..fd873fa --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_delete_signature.php @@ -0,0 +1,25 @@ +deleteSignature($signature_id); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Delete Signature $signature_id Successfully\n"; +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_delete_template.php b/vendor/qiniu/php-sdk/examples/sms/sms_delete_template.php new file mode 100644 index 0000000..4590835 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_delete_template.php @@ -0,0 +1,25 @@ +deleteTemplate($template_id); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Delete Template $template_id Successfully\n"; +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_edit_signature.php b/vendor/qiniu/php-sdk/examples/sms/sms_edit_signature.php new file mode 100644 index 0000000..edf14e0 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_edit_signature.php @@ -0,0 +1,30 @@ +updateSignature($id, $signature, $source, $pics); + +echo "\n====> edit signature result: \n"; +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Update Signature Successfully\n"; +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_edit_template.php b/vendor/qiniu/php-sdk/examples/sms/sms_edit_template.php new file mode 100644 index 0000000..1be5509 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_edit_template.php @@ -0,0 +1,31 @@ +updateTemplate($template_id, $name, $template, $description, $signature_id); + +echo "\n====> edit template result: \n"; +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Update Template Successfully\n"; +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_query_send_sms.php b/vendor/qiniu/php-sdk/examples/sms/sms_query_send_sms.php new file mode 100644 index 0000000..cdbbe71 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_query_send_sms.php @@ -0,0 +1,50 @@ +querySendSms( + $job_id, + $message_id, + $mobile, + $status, + $template_id, + $type, + $start, + $end, + $page, + $page_size +); +echo "\n====> query send sms result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_query_signature.php b/vendor/qiniu/php-sdk/examples/sms/sms_query_signature.php new file mode 100644 index 0000000..224d09b --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_query_signature.php @@ -0,0 +1,28 @@ +querySignature($audit_status, $page, $page_size); +echo "\n====> query signature result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_query_single_signature.php b/vendor/qiniu/php-sdk/examples/sms/sms_query_single_signature.php new file mode 100644 index 0000000..8afb4d5 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_query_single_signature.php @@ -0,0 +1,26 @@ +checkSingleSignature($signature_id); +echo "\n====> query single signature result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_query_single_template.php b/vendor/qiniu/php-sdk/examples/sms/sms_query_single_template.php new file mode 100644 index 0000000..8e0b279 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_query_single_template.php @@ -0,0 +1,26 @@ +querySingleTemplate($template_id); +echo "\n====> query single template result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_query_template.php b/vendor/qiniu/php-sdk/examples/sms/sms_query_template.php new file mode 100644 index 0000000..6be260e --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_query_template.php @@ -0,0 +1,28 @@ +queryTemplate($audit_status, $page, $page_size); +echo "\n====> query template result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_send_message.php b/vendor/qiniu/php-sdk/examples/sms/sms_send_message.php new file mode 100644 index 0000000..d943e52 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_send_message.php @@ -0,0 +1,32 @@ + 'xxxx'); + +list($ret, $err) = $client->sendMessage($template_id, $mobiles, $code); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Send Message Successfully: \n"; + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/update_bucketEvent.php b/vendor/qiniu/php-sdk/examples/update_bucketEvent.php new file mode 100644 index 0000000..7b0d1d0 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/update_bucketEvent.php @@ -0,0 +1,31 @@ +updateBucketEvent($bucket, $name, $prefix, $suffix, $event, $callbackURL); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/update_bucketLifecycleRule.php b/vendor/qiniu/php-sdk/examples/update_bucketLifecycleRule.php new file mode 100644 index 0000000..73f0f56 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/update_bucketLifecycleRule.php @@ -0,0 +1,36 @@ +updateBucketLifecycleRule( + $bucket, + $name, + $prefix, + $delete_after_days, + $to_line_after_days +); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/upload_and_callback.php b/vendor/qiniu/php-sdk/examples/upload_and_callback.php new file mode 100644 index 0000000..a0c793a --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_and_callback.php @@ -0,0 +1,31 @@ + 'http://your.domain.com/upload_verify_callback.php', + 'callbackBody' => 'filename=$(fname)&filesize=$(fsize)' +); +$uptoken = $auth->uploadToken($bucket, null, 3600, $policy); + +// 上传文件的本地路径 +$filePath = './php-logo.png'; + +$uploadMgr = new UploadManager(); +list($ret, $err) = $uploadMgr->putFile($uptoken, null, $filePath); +echo "\n====> putFile result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/upload_and_pfop.php b/vendor/qiniu/php-sdk/examples/upload_and_pfop.php new file mode 100644 index 0000000..32c1eb5 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_and_pfop.php @@ -0,0 +1,49 @@ + $pfop, + 'persistentNotifyUrl' => $notifyUrl, + 'persistentPipeline' => $pipeline +); +$token = $auth->uploadToken($bucket, null, 3600, $policy); + +list($ret, $err) = $uploadMgr->putFile($token, $key, $filePath); +echo "\n====> putFile result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/upload_mgr_init.php b/vendor/qiniu/php-sdk/examples/upload_mgr_init.php new file mode 100644 index 0000000..1164c90 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_mgr_init.php @@ -0,0 +1,19 @@ +uploadToken($bucket); + +// 构建 UploadManager 对象 +$uploadMgr = new UploadManager(); diff --git a/vendor/qiniu/php-sdk/examples/upload_multi_demos.php b/vendor/qiniu/php-sdk/examples/upload_multi_demos.php new file mode 100644 index 0000000..d724235 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_multi_demos.php @@ -0,0 +1,89 @@ +uploadToken($bucket); +$uploadMgr = new UploadManager(); + +//---------------------------------------- upload demo1 ---------------------------------------- +// 上传字符串到七牛 + +list($ret, $err) = $uploadMgr->put($token, null, 'content string'); +echo "\n====> put result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} + + +//---------------------------------------- upload demo2 ---------------------------------------- +// 上传文件到七牛 + +$filePath = './php-logo.png'; +$key = 'php-logo.png'; +list($ret, $err) = $uploadMgr->putFile($token, $key, $filePath); +echo "\n====> putFile result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} + + +//---------------------------------------- upload demo3 ---------------------------------------- +// 上传文件到七牛后, 七牛将文件名和文件大小回调给业务服务器. +// 可参考文档: https://developer.qiniu.com/kodo/manual/1206/put-policy + +$policy = array( + 'callbackUrl' => 'http://172.30.251.210/upload_verify_callback.php', + 'callbackBody' => 'filename=$(fname)&filesize=$(fsize)' +// 'callbackBodyType' => 'application/json', +// 'callbackBody' => '{"filename":$(fname), "filesize": $(fsize)}' //设置application/json格式回调 +); +$token = $auth->uploadToken($bucket, null, 3600, $policy); + + +list($ret, $err) = $uploadMgr->putFile($token, null, $key); +echo "\n====> putFile result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} + + +//---------------------------------------- upload demo4 ---------------------------------------- +// 上传视频,上传完成后进行 m3u8 的转码, 并给视频打水印 + +$wmImg = Qiniu\base64_urlSafeEncode('http://devtools.qiniudn.com/qiniu.png'); +$pfop = "avthumb/m3u8/wmImage/$wmImg"; + +// 转码完成后回调到业务服务器。(公网可以访问,并相应 200 OK) +$notifyUrl = 'http://notify.fake.com'; + +$policy = array( + 'persistentOps' => $pfop, + 'persistentNotifyUrl' => $notifyUrl, + 'persistentPipeline' => $pipeline +); +$token = $auth->uploadToken($bucket, null, 3600, $policy); +print($token); +list($ret, $err) = $uploadMgr->putFile($token, null, $key); +echo "\n====> putFile result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/upload_simple_file.php b/vendor/qiniu/php-sdk/examples/upload_simple_file.php new file mode 100644 index 0000000..f495a02 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_simple_file.php @@ -0,0 +1,37 @@ +uploadToken($bucket); + +// 要上传文件的本地路径 +$filePath = './php-logo.png'; + +// 上传到七牛存储后保存的文件名 +$key = 'my-php-logo.png'; + +// 初始化 UploadManager 对象并进行文件的上传。 +$uploadMgr = new UploadManager(); + +// 调用 UploadManager 的 putFile 方法进行文件的上传,该方法会判断文件大小,进而决定使用表单上传还是分片上传,无需手动配置。 +list($ret, $err) = $uploadMgr->putFile($token, $key, $filePath); +echo "\n====> putFile result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/upload_tokens.php b/vendor/qiniu/php-sdk/examples/upload_tokens.php new file mode 100644 index 0000000..d2cf02c --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_tokens.php @@ -0,0 +1,82 @@ +uploadToken($bucket, null, $expires, $policy, true); +print($upToken . "\n"); + +//---------------------------------------- demo2 ---------------------------------------- +// 自定义凭证有效期(示例2小时) + +$expires = 7200; +$upToken = $auth->uploadToken($bucket, null, $expires, $policy, true); +print($upToken . "\n"); + +//---------------------------------------- demo3 ---------------------------------------- +// 覆盖上传凭证 + +$expires = 3600; +$keyToOverwrite = 'qiniu.mp4'; +$upToken = $auth->uploadToken($bucket, $keyToOverwrite, $expires, $policy, true); +print($upToken . "\n"); + +//---------------------------------------- demo4 ---------------------------------------- +// 自定义上传回复(非callback模式)凭证 + +$returnBody = '{"key":"$(key)","hash":"$(etag)","fsize":$(fsize),"bucket":"$(bucket)","name":"$(x:name)"}'; +$policy = array( + 'returnBody' => $returnBody +); +$upToken = $auth->uploadToken($bucket, null, $expires, $policy, true); +print($upToken . "\n"); + +//---------------------------------------- demo5 ---------------------------------------- +// 带回调业务服务器的凭证(application/json) + +$policy = array( + 'callbackUrl' => 'http://api.example.com/qiniu/upload/callback', + 'callbackBody' => '{"key":"$(key)","hash":"$(etag)","fsize":$(fsize),"bucket":"$(bucket)","name":"$(x:name)"}', + 'callbackBodyType' => 'application/json' +); +$upToken = $auth->uploadToken($bucket, null, $expires, $policy, true); +print($upToken . "\n"); + +//---------------------------------------- demo6 ---------------------------------------- +// 带回调业务服务器的凭证(application/x-www-form-urlencoded) + +$policy = array( + 'callbackUrl' => 'http://api.example.com/qiniu/upload/callback', + 'callbackBody' => 'key=$(key)&hash=$(etag)&bucket=$(bucket)&fsize=$(fsize)&name=$(x:name)' +); +$upToken = $auth->uploadToken($bucket, null, $expires, $policy, true); +print($upToken . "\n"); + +//---------------------------------------- demo7 ---------------------------------------- +// 带数据处理的凭证 + +$saveMp4Entry = \Qiniu\base64_urlSafeEncode($bucket . ":avthumb_test_target.mp4"); +$saveJpgEntry = \Qiniu\base64_urlSafeEncode($bucket . ":vframe_test_target.jpg"); +$avthumbMp4Fop = "avthumb/mp4|saveas/" . $saveMp4Entry; +$vframeJpgFop = "vframe/jpg/offset/1|saveas/" . $saveJpgEntry; +$policy = array( + 'persistentOps' => $avthumbMp4Fop . ";" . $vframeJpgFop, + 'persistentPipeline' => "video-pipe", + 'persistentNotifyUrl' => "http://api.example.com/qiniu/pfop/notify", +); +$upToken = $auth->uploadToken($bucket, null, $expires, $policy, true); +print($upToken . "\n"); diff --git a/vendor/qiniu/php-sdk/examples/upload_verify_callback.php b/vendor/qiniu/php-sdk/examples/upload_verify_callback.php new file mode 100644 index 0000000..dcb64c9 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_verify_callback.php @@ -0,0 +1,34 @@ +verifyCallback($contentType, $authorization, $url, $callbackBody); + +if ($isQiniuCallback) { + $resp = array('ret' => 'success'); +} else { + $resp = array('ret' => 'failed'); +} + +echo json_encode($resp); diff --git a/vendor/qiniu/php-sdk/examples/upload_with_qvmzone.php b/vendor/qiniu/php-sdk/examples/upload_with_qvmzone.php new file mode 100644 index 0000000..ce2b21f --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_with_qvmzone.php @@ -0,0 +1,40 @@ +uploadToken($bucket); + +// 上传文件的本地路径 +$filePath = './php-logo.png'; + +// 七牛云主机QVM和七牛对象存储KODO内网上传,目前支持华东1区域(杭州)和华北2区域(北京)的云主机可以访问同区域的对象存储服务 +// 参考文档:https://developer.qiniu.com/qvm/manual/4269/qvm-kodo + +$zone = Zone::qvmZonez0(); // 华东:z0,华北:z1 +$config = new Config($zone); +$config->useHTTPS = true; + +// 指定 config +$uploadMgr = new UploadManager($config); + +list($ret, $err) = $uploadMgr->putFile($uptoken, $key, $filePath); +echo "\n====> putFile result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/upload_with_zone.php b/vendor/qiniu/php-sdk/examples/upload_with_zone.php new file mode 100644 index 0000000..6192666 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_with_zone.php @@ -0,0 +1,39 @@ +uploadToken($bucket); + +// 上传文件的本地路径 +$filePath = './php-logo.png'; + +// 指定 zone 上传 +// 参考文档:https://developer.qiniu.com/kodo/manual/1671/region-endpoint +$zone = Zone::zonez0(); // 华东:z0,华北:z1,华南:z2,北美:na0,东南亚:as0 +$config = new Config($zone); +$config->useHTTPS = true; + +// 指定 config +$uploadMgr = new UploadManager($config); + +list($ret, $err) = $uploadMgr->putFile($uptoken, $key, $filePath); +echo "\n====> putFile result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/phpunit.xml.dist b/vendor/qiniu/php-sdk/phpunit.xml.dist new file mode 100644 index 0000000..840f6e5 --- /dev/null +++ b/vendor/qiniu/php-sdk/phpunit.xml.dist @@ -0,0 +1,18 @@ + + + + + tests + + + + diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Auth.php b/vendor/qiniu/php-sdk/src/Qiniu/Auth.php new file mode 100644 index 0000000..d99c365 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Auth.php @@ -0,0 +1,255 @@ +accessKey = $accessKey; + $this->secretKey = $secretKey; + $defaultOptions = array( + 'disableQiniuTimestampSignature' => null + ); + if ($options == null) { + $options = $defaultOptions; + } + $this->options = array_merge($defaultOptions, $options); + } + + public function getAccessKey() + { + return $this->accessKey; + } + + public function sign($data) + { + $hmac = hash_hmac('sha1', $data, $this->secretKey, true); + return $this->accessKey . ':' . \Qiniu\base64_urlSafeEncode($hmac); + } + + public function signWithData($data) + { + $encodedData = \Qiniu\base64_urlSafeEncode($data); + return $this->sign($encodedData) . ':' . $encodedData; + } + + public function signRequest($urlString, $body, $contentType = null) + { + $url = parse_url($urlString); + $data = ''; + if (array_key_exists('path', $url)) { + $data = $url['path']; + } + if (array_key_exists('query', $url)) { + $data .= '?' . $url['query']; + } + $data .= "\n"; + + if ($body !== null && $contentType === 'application/x-www-form-urlencoded') { + $data .= $body; + } + return $this->sign($data); + } + + /** + * @param string $urlString + * @param string $method + * @param string $body + * @param null|Header $headers + */ + public function signQiniuAuthorization($urlString, $method = "GET", $body = "", $headers = null) + { + $url = parse_url($urlString); + if (!$url) { + return array(null, new \Exception("parse_url error")); + } + + // append method, path and query + if ($method === "") { + $data = "GET "; + } else { + $data = $method . " "; + } + if (isset($url["path"])) { + $data .= $url["path"]; + } + if (isset($url["query"])) { + $data .= "?" . $url["query"]; + } + + // append Host + $data .= "\n"; + $data .= "Host: "; + if (isset($url["host"])) { + $data .= $url["host"]; + } + if (isset($url["port"]) && $url["port"] > 0) { + $data .= ":" . $url["port"]; + } + + // try append content type + if ($headers != null && isset($headers["Content-Type"])) { + // append content type + $data .= "\n"; + $data .= "Content-Type: " . $headers["Content-Type"]; + } + + // try append xQiniuHeaders + if ($headers != null) { + $headerLines = array(); + $keyPrefix = "X-Qiniu-"; + foreach ($headers as $k => $v) { + if (strlen($k) > strlen($keyPrefix) && strpos($k, $keyPrefix) === 0) { + array_push( + $headerLines, + $k . ": " . $v + ); + } + } + if (count($headerLines) > 0) { + $data .= "\n"; + sort($headerLines); + $data .= implode("\n", $headerLines); + } + } + + // append body + $data .= "\n\n"; + if (!is_null($body) + && strlen($body) > 0 + && isset($headers["Content-Type"]) + && $headers["Content-Type"] != "application/octet-stream" + ) { + $data .= $body; + } + + return array($this->sign($data), null); + } + + public function verifyCallback($contentType, $originAuthorization, $url, $body) + { + $authorization = 'QBox ' . $this->signRequest($url, $body, $contentType); + return $originAuthorization === $authorization; + } + + public function privateDownloadUrl($baseUrl, $expires = 3600) + { + $deadline = time() + $expires; + + $pos = strpos($baseUrl, '?'); + if ($pos !== false) { + $baseUrl .= '&e='; + } else { + $baseUrl .= '?e='; + } + $baseUrl .= $deadline; + + $token = $this->sign($baseUrl); + return "$baseUrl&token=$token"; + } + + public function uploadToken($bucket, $key = null, $expires = 3600, $policy = null, $strictPolicy = true) + { + $deadline = time() + $expires; + $scope = $bucket; + if ($key !== null) { + $scope .= ':' . $key; + } + + $args = self::copyPolicy($args, $policy, $strictPolicy); + $args['scope'] = $scope; + $args['deadline'] = $deadline; + + $b = json_encode($args); + return $this->signWithData($b); + } + + /** + *上传策略,参数规格详见 + *http://developer.qiniu.com/docs/v6/api/reference/security/put-policy.html + */ + private static $policyFields = array( + 'callbackUrl', + 'callbackBody', + 'callbackHost', + 'callbackBodyType', + 'callbackFetchKey', + + 'returnUrl', + 'returnBody', + + 'endUser', + 'saveKey', + 'forceSaveKey', + 'insertOnly', + + 'detectMime', + 'mimeLimit', + 'fsizeMin', + 'fsizeLimit', + + 'persistentOps', + 'persistentNotifyUrl', + 'persistentPipeline', + + 'deleteAfterDays', + 'fileType', + 'isPrefixalScope', + ); + + private static function copyPolicy(&$policy, $originPolicy, $strictPolicy) + { + if ($originPolicy === null) { + return array(); + } + foreach ($originPolicy as $key => $value) { + if (!$strictPolicy || in_array((string)$key, self::$policyFields, true)) { + $policy[$key] = $value; + } + } + return $policy; + } + + public function authorization($url, $body = null, $contentType = null) + { + $authorization = 'QBox ' . $this->signRequest($url, $body, $contentType); + return array('Authorization' => $authorization); + } + + public function authorizationV2($url, $method, $body = null, $contentType = null) + { + $headers = new Header(); + $result = array(); + if ($contentType != null) { + $headers['Content-Type'] = $contentType; + $result['Content-Type'] = $contentType; + } + + $signDate = gmdate('Ymd\THis\Z', time()); + if ($this->options['disableQiniuTimestampSignature'] !== null) { + if (!$this->options['disableQiniuTimestampSignature']) { + $headers['X-Qiniu-Date'] = $signDate; + $result['X-Qiniu-Date'] = $signDate; + } + } elseif (getenv("DISABLE_QINIU_TIMESTAMP_SIGNATURE")) { + if (strtolower(getenv("DISABLE_QINIU_TIMESTAMP_SIGNATURE")) !== "true") { + $headers['X-Qiniu-Date'] = $signDate; + $result['X-Qiniu-Date'] = $signDate; + } + } else { + $headers['X-Qiniu-Date'] = $signDate; + $result['X-Qiniu-Date'] = $signDate; + } + + list($sign) = $this->signQiniuAuthorization($url, $method, $body, $headers); + $result['Authorization'] = 'Qiniu ' . $sign; + return $result; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Cdn/CdnManager.php b/vendor/qiniu/php-sdk/src/Qiniu/Cdn/CdnManager.php new file mode 100644 index 0000000..60052d3 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Cdn/CdnManager.php @@ -0,0 +1,263 @@ +auth = $auth; + $this->server = 'http://fusion.qiniuapi.com'; + $this->proxy = new Proxy($proxy, $proxy_auth, $proxy_user_password); + } + + /** + * @param array $urls 待刷新的文件链接数组 + * @return array + */ + public function refreshUrls(array $urls) + { + return $this->refreshUrlsAndDirs($urls, array()); + } + + /** + * @param array $dirs 待刷新的文件链接数组 + * @return array + * 目前客户默认没有目录刷新权限,刷新会有400038报错,参考:https://developer.qiniu.com/fusion/api/1229/cache-refresh + * 需要刷新目录请工单联系技术支持 https://support.qiniu.com/tickets/category + */ + public function refreshDirs(array $dirs) + { + return $this->refreshUrlsAndDirs(array(), $dirs); + } + + /** + * @param array $urls 待刷新的文件链接数组 + * @param array $dirs 待刷新的目录链接数组 + * + * @return array 刷新的请求回复和错误,参考 examples/cdn_manager.php 代码 + * @link http://developer.qiniu.com/article/fusion/api/refresh.html + * + * 目前客户默认没有目录刷新权限,刷新会有400038报错,参考:https://developer.qiniu.com/fusion/api/1229/cache-refresh + * 需要刷新目录请工单联系技术支持 https://support.qiniu.com/tickets/category + */ + public function refreshUrlsAndDirs(array $urls, array $dirs) + { + $req = array(); + if (!empty($urls)) { + $req['urls'] = $urls; + } + if (!empty($dirs)) { + $req['dirs'] = $dirs; + } + + $url = $this->server . '/v2/tune/refresh'; + $body = json_encode($req); + return $this->post($url, $body); + } + + /** + * 查询 CDN 刷新记录 + * + * @param string $requestId 指定要查询记录所在的刷新请求id + * @param string $isDir 指定是否查询目录,取值为 yes/no,默认不填则为两种类型记录都查询 + * @param array $urls 要查询的url列表,每个url可以是文件url,也可以是目录url + * @param string $state 指定要查询记录的状态,取值processing/success/failure + * @param int $pageNo 要求返回的页号,默认为0 + * @param int $pageSize 要求返回的页长度,默认为100 + * @param string $startTime 指定查询的开始日期,格式2006-01-01 + * @param string $endTime 指定查询的结束日期,格式2006-01-01 + * @return array + * @link https://developer.qiniu.com/fusion/api/1229/cache-refresh#4 + */ + public function getCdnRefreshList( + $requestId = null, + $isDir = null, + $urls = array(), + $state = null, + $pageNo = 0, + $pageSize = 100, + $startTime = null, + $endTime = null + ) { + $req = array(); + \Qiniu\setWithoutEmpty($req, 'requestId', $requestId); + \Qiniu\setWithoutEmpty($req, 'isDir', $isDir); + \Qiniu\setWithoutEmpty($req, 'urls', $urls); + \Qiniu\setWithoutEmpty($req, 'state', $state); + \Qiniu\setWithoutEmpty($req, 'pageNo', $pageNo); + \Qiniu\setWithoutEmpty($req, 'pageSize', $pageSize); + \Qiniu\setWithoutEmpty($req, 'startTime', $startTime); + \Qiniu\setWithoutEmpty($req, 'endTime', $endTime); + + $body = json_encode($req); + $url = $this->server . '/v2/tune/refresh/list'; + return $this->post($url, $body); + } + + /** + * @param array $urls 待预取的文件链接数组 + * + * @return array 预取的请求回复和错误,参考 examples/cdn_manager.php 代码 + * + * @link http://developer.qiniu.com/article/fusion/api/refresh.html + */ + public function prefetchUrls(array $urls) + { + $req = array( + 'urls' => $urls, + ); + + $url = $this->server . '/v2/tune/prefetch'; + $body = json_encode($req); + return $this->post($url, $body); + } + + /** + * 查询 CDN 预取记录 + * + * @param string $requestId 指定要查询记录所在的刷新请求id + * @param array $urls 要查询的url列表,每个url可以是文件url,也可以是目录url + * @param string $state 指定要查询记录的状态,取值processing/success/failure + * @param int $pageNo 要求返回的页号,默认为0 + * @param int $pageSize 要求返回的页长度,默认为100 + * @param string $startTime 指定查询的开始日期,格式2006-01-01 + * @param string $endTime 指定查询的结束日期,格式2006-01-01 + * @return array + * @link https://developer.qiniu.com/fusion/api/1227/file-prefetching#4 + */ + public function getCdnPrefetchList( + $requestId = null, + $urls = array(), + $state = null, + $pageNo = 0, + $pageSize = 100, + $startTime = null, + $endTime = null + ) { + $req = array(); + \Qiniu\setWithoutEmpty($req, 'requestId', $requestId); + \Qiniu\setWithoutEmpty($req, 'urls', $urls); + \Qiniu\setWithoutEmpty($req, 'state', $state); + \Qiniu\setWithoutEmpty($req, 'pageNo', $pageNo); + \Qiniu\setWithoutEmpty($req, 'pageSize', $pageSize); + \Qiniu\setWithoutEmpty($req, 'startTime', $startTime); + \Qiniu\setWithoutEmpty($req, 'endTime', $endTime); + + $body = json_encode($req); + $url = $this->server . '/v2/tune/prefetch/list'; + return $this->post($url, $body); + } + + /** + * @param array $domains 待获取带宽数据的域名数组 + * @param string $startDate 开始的日期,格式类似 2017-01-01 + * @param string $endDate 结束的日期,格式类似 2017-01-01 + * @param string $granularity 获取数据的时间间隔,可以是 5min, hour 或者 day + * + * @return array 带宽数据和错误信息,参考 examples/cdn_manager.php 代码 + * + * @link http://developer.qiniu.com/article/fusion/api/traffic-bandwidth.html + */ + public function getBandwidthData(array $domains, $startDate, $endDate, $granularity) + { + $req = array(); + $req['domains'] = implode(';', $domains); + $req['startDate'] = $startDate; + $req['endDate'] = $endDate; + $req['granularity'] = $granularity; + + $url = $this->server . '/v2/tune/bandwidth'; + $body = json_encode($req); + return $this->post($url, $body); + } + + /** + * @param array $domains 待获取流量数据的域名数组 + * @param string $startDate 开始的日期,格式类似 2017-01-01 + * @param string $endDate 结束的日期,格式类似 2017-01-01 + * @param string $granularity 获取数据的时间间隔,可以是 5min, hour 或者 day + * + * @return array 流量数据和错误信息,参考 examples/cdn_manager.php 代码 + * + * @link http://developer.qiniu.com/article/fusion/api/traffic-bandwidth.html + */ + public function getFluxData(array $domains, $startDate, $endDate, $granularity) + { + $req = array(); + $req['domains'] = implode(';', $domains); + $req['startDate'] = $startDate; + $req['endDate'] = $endDate; + $req['granularity'] = $granularity; + + $url = $this->server . '/v2/tune/flux'; + $body = json_encode($req); + return $this->post($url, $body); + } + + /** + * @param array $domains 待获取日志下载链接的域名数组 + * @param string $logDate 获取指定日期的日志下载链接,格式类似 2017-01-01 + * + * @return array 日志下载链接数据和错误信息,参考 examples/cdn_manager.php 代码 + * + * @link http://developer.qiniu.com/article/fusion/api/log.html + */ + public function getCdnLogList(array $domains, $logDate) + { + $req = array(); + $req['domains'] = implode(';', $domains); + $req['day'] = $logDate; + + $url = $this->server . '/v2/tune/log/list'; + $body = json_encode($req); + return $this->post($url, $body); + } + + private function post($url, $body) + { + $headers = $this->auth->authorization($url, $body, 'application/json'); + $headers['Content-Type'] = 'application/json'; + $ret = Client::post($url, $body, $headers, $this->proxy->makeReqOpt()); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + return array($r, null); + } + + /** + * 构建时间戳防盗链鉴权的访问外链 + * + * @param string $rawUrl 需要签名的资源url + * @param string $encryptKey 时间戳防盗链密钥 + * @param string $durationInSeconds 链接的有效期(以秒为单位) + * + * @return string 带鉴权信息的资源外链,参考 examples/cdn_timestamp_antileech.php 代码 + */ + public static function createTimestampAntiLeechUrl($rawUrl, $encryptKey, $durationInSeconds) + { + $parsedUrl = parse_url($rawUrl); + $deadline = time() + $durationInSeconds; + $expireHex = dechex($deadline); + $path = isset($parsedUrl['path']) ? $parsedUrl['path'] : ''; + $strToSign = $encryptKey . $path . $expireHex; + $signStr = md5($strToSign); + if (isset($parsedUrl['query'])) { + $signedUrl = $rawUrl . '&sign=' . $signStr . '&t=' . $expireHex; + } else { + $signedUrl = $rawUrl . '?sign=' . $signStr . '&t=' . $expireHex; + } + return $signedUrl; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Config.php b/vendor/qiniu/php-sdk/src/Qiniu/Config.php new file mode 100644 index 0000000..75dfc94 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Config.php @@ -0,0 +1,398 @@ +zone = $z; + $this->useHTTPS = false; + $this->useCdnDomains = false; + $this->regionCache = array(); + $this->ucHost = Config::UC_HOST; + $this->queryRegionHost = Config::QUERY_REGION_HOST; + $this->backupQueryRegionHosts = array( + "uc.qbox.me", + "api.qiniu.com" + ); + $this->backupUcHostsRetryTimes = 2; + } + + public function setUcHost($ucHost) + { + $this->ucHost = $ucHost; + $this->setQueryRegionHost($ucHost); + } + + public function getUcHost() + { + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + return $scheme . $this->ucHost; + } + + public function setQueryRegionHost($host, $backupHosts = array()) + { + $this->queryRegionHost = $host; + $this->backupQueryRegionHosts = $backupHosts; + } + + public function getQueryRegionHost() + { + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + return $scheme . $this->queryRegionHost; + } + + public function setBackupQueryRegionHosts($hosts = array()) + { + $this->backupQueryRegionHosts = $hosts; + } + + public function getBackupQueryRegionHosts() + { + return $this->backupQueryRegionHosts; + } + + public function getUpHost($accessKey, $bucket, $reqOpt = null) + { + $region = $this->getRegion($accessKey, $bucket, $reqOpt); + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + $host = $region->srcUpHosts[0]; + if ($this->useCdnDomains === true) { + $host = $region->cdnUpHosts[0]; + } + + return $scheme . $host; + } + + public function getUpHostV2($accessKey, $bucket, $reqOpt = null) + { + list($region, $err) = $this->getRegionV2($accessKey, $bucket, $reqOpt); + if ($err != null) { + return array(null, $err); + } + + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + $host = $region->srcUpHosts[0]; + if ($this->useCdnDomains === true) { + $host = $region->cdnUpHosts[0]; + } + + return array($scheme . $host, null); + } + + public function getUpBackupHost($accessKey, $bucket, $reqOpt = null) + { + $region = $this->getRegion($accessKey, $bucket, $reqOpt); + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + $host = $region->cdnUpHosts[0]; + if ($this->useCdnDomains === true) { + $host = $region->srcUpHosts[0]; + } + + return $scheme . $host; + } + + public function getUpBackupHostV2($accessKey, $bucket, $reqOpt = null) + { + list($region, $err) = $this->getRegionV2($accessKey, $bucket, $reqOpt); + if ($err != null) { + return array(null, $err); + } + + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + $host = $region->cdnUpHosts[0]; + if ($this->useCdnDomains === true) { + $host = $region->srcUpHosts[0]; + } + + return array($scheme . $host, null); + } + + public function getRsHost($accessKey, $bucket, $reqOpt = null) + { + $region = $this->getRegion($accessKey, $bucket, $reqOpt); + + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + return $scheme . $region->rsHost; + } + + public function getRsHostV2($accessKey, $bucket, $reqOpt = null) + { + list($region, $err) = $this->getRegionV2($accessKey, $bucket, $reqOpt); + if ($err != null) { + return array(null, $err); + } + + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + return array($scheme . $region->rsHost, null); + } + + public function getRsfHost($accessKey, $bucket, $reqOpt = null) + { + $region = $this->getRegion($accessKey, $bucket, $reqOpt); + + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + return $scheme . $region->rsfHost; + } + + public function getRsfHostV2($accessKey, $bucket, $reqOpt = null) + { + list($region, $err) = $this->getRegionV2($accessKey, $bucket, $reqOpt); + if ($err != null) { + return array(null, $err); + } + + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + return array($scheme . $region->rsfHost, null); + } + + public function getIovipHost($accessKey, $bucket, $reqOpt = null) + { + $region = $this->getRegion($accessKey, $bucket, $reqOpt); + + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + return $scheme . $region->iovipHost; + } + + public function getIovipHostV2($accessKey, $bucket, $reqOpt = null) + { + list($region, $err) = $this->getRegionV2($accessKey, $bucket, $reqOpt); + if ($err != null) { + return array(null, $err); + } + + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + return array($scheme . $region->iovipHost, null); + } + + public function getApiHost($accessKey, $bucket, $reqOpt = null) + { + $region = $this->getRegion($accessKey, $bucket, $reqOpt); + + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + return $scheme . $region->apiHost; + } + + public function getApiHostV2($accessKey, $bucket, $reqOpt = null) + { + list($region, $err) = $this->getRegionV2($accessKey, $bucket, $reqOpt); + if ($err != null) { + return array(null, $err); + } + + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + return array($scheme . $region->apiHost, null); + } + + + /** + * 从缓存中获取区域 + * + * @param string $cacheId 缓存 ID + * @return null|Region + */ + private function getRegionCache($cacheId) + { + if (isset($this->regionCache[$cacheId]) && + isset($this->regionCache[$cacheId]["deadline"]) && + time() < $this->regionCache[$cacheId]["deadline"]) { + return $this->regionCache[$cacheId]["region"]; + } + + return null; + } + + /** + * 将区域设置到缓存中 + * + * @param string $cacheId 缓存 ID + * @param Region $region 缓存 ID + * @return void + */ + private function setRegionCache($cacheId, $region) + { + $this->regionCache[$cacheId] = array( + "region" => $region, + ); + if (isset($region->ttl)) { + $this->regionCache[$cacheId]["deadline"] = time() + $region->ttl; + } + } + + /** + * 从缓存中获取区域 + * + * @param string $accessKey + * @param string $bucket + * @return Region + * + * @throws \Exception + */ + private function getRegion($accessKey, $bucket, $reqOpt = null) + { + if (isset($this->zone)) { + return $this->zone; + } + + $cacheId = "$accessKey:$bucket"; + $regionCache = $this->getRegionCache($cacheId); + if ($regionCache) { + return $regionCache; + } + + $region = Zone::queryZone( + $accessKey, + $bucket, + $this->getQueryRegionHost(), + $this->getBackupQueryRegionHosts(), + $this->backupUcHostsRetryTimes, + $reqOpt + ); + if (is_array($region)) { + list($region, $err) = $region; + if ($err != null) { + throw new \Exception($err->message()); + } + } + + $this->setRegionCache($cacheId, $region); + return $region; + } + + private function getRegionV2($accessKey, $bucket, $reqOpt = null) + { + if (isset($this->zone)) { + return array($this->zone, null); + } + + $cacheId = "$accessKey:$bucket"; + $regionCache = $this->getRegionCache($cacheId); + if (isset($regionCache)) { + return array($regionCache, null); + } + + $region = Zone::queryZone( + $accessKey, + $bucket, + $this->getQueryRegionHost(), + $this->getBackupQueryRegionHosts(), + $this->backupUcHostsRetryTimes, + $reqOpt + ); + if (is_array($region)) { + list($region, $err) = $region; + return array($region, $err); + } + + $this->setRegionCache($cacheId, $region); + return array($region, null); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Enum/QiniuEnum.php b/vendor/qiniu/php-sdk/src/Qiniu/Enum/QiniuEnum.php new file mode 100644 index 0000000..8399b54 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Enum/QiniuEnum.php @@ -0,0 +1,53 @@ + $val) { + array_push($data, '--' . $mimeBoundary); + array_push($data, "Content-Disposition: form-data; name=\"$key\""); + array_push($data, ''); + array_push($data, $val); + } + + array_push($data, '--' . $mimeBoundary); + $finalMimeType = empty($mimeType) ? 'application/octet-stream' : $mimeType; + $finalFileName = self::escapeQuotes($fileName); + array_push($data, "Content-Disposition: form-data; name=\"$name\"; filename=\"$finalFileName\""); + array_push($data, "Content-Type: $finalMimeType"); + array_push($data, ''); + array_push($data, $fileBody); + + array_push($data, '--' . $mimeBoundary . '--'); + array_push($data, ''); + + $body = implode("\r\n", $data); + $contentType = 'multipart/form-data; boundary=' . $mimeBoundary; + $headers['Content-Type'] = $contentType; + $request = new Request('POST', $url, $headers, $body, $opt); + return self::sendRequest($request); + } + + private static function userAgent() + { + $sdkInfo = "QiniuPHP/" . Config::SDK_VER; + + $systemInfo = php_uname("s"); + $machineInfo = php_uname("m"); + + $envInfo = "($systemInfo/$machineInfo)"; + + $phpVer = phpversion(); + + $ua = "$sdkInfo $envInfo PHP/$phpVer"; + return $ua; + } + + /** + * @param Request $request + * @return Response + */ + public static function sendRequestWithMiddleware($request) + { + $middlewares = $request->opt->middlewares; + $handle = Middleware\compose($middlewares, function ($req) { + return Client::sendRequest($req); + }); + return $handle($request); + } + + /** + * @param Request $request + * @return Response + */ + public static function sendRequest($request) + { + $t1 = microtime(true); + $ch = curl_init(); + $options = array( + CURLOPT_USERAGENT => self::userAgent(), + CURLOPT_RETURNTRANSFER => true, + CURLOPT_HEADER => true, + CURLOPT_NOBODY => false, + CURLOPT_CUSTOMREQUEST => $request->method, + CURLOPT_URL => $request->url, + ); + foreach ($request->opt->getCurlOpt() as $k => $v) { + $options[$k] = $v; + } + // Handle open_basedir & safe mode + if (!ini_get('safe_mode') && !ini_get('open_basedir')) { + $options[CURLOPT_FOLLOWLOCATION] = true; + } + if (!empty($request->headers)) { + $headers = array(); + foreach ($request->headers as $key => $val) { + array_push($headers, "$key: $val"); + } + $options[CURLOPT_HTTPHEADER] = $headers; + } + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); + if (!empty($request->body)) { + $options[CURLOPT_POSTFIELDS] = $request->body; + } + curl_setopt_array($ch, $options); + $result = curl_exec($ch); + $t2 = microtime(true); + $duration = round($t2 - $t1, 3); + $ret = curl_errno($ch); + if ($ret !== 0) { + $r = new Response(-1, $duration, array(), null, curl_error($ch)); + curl_close($ch); + return $r; + } + $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); + $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); + $headers = Header::parseRawText(substr($result, 0, $header_size)); + $body = substr($result, $header_size); + curl_close($ch); + return new Response($code, $duration, $headers, $body, null); + } + + private static function escapeQuotes($str) + { + if (is_null($str)) { + return null; + } + $find = array("\\", "\""); + $replace = array("\\\\", "\\\""); + return str_replace($find, $replace, $str); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Http/Error.php b/vendor/qiniu/php-sdk/src/Qiniu/Http/Error.php new file mode 100644 index 0000000..8fba74f --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Http/Error.php @@ -0,0 +1,38 @@ + + * {"error" : "detailed error message"} + * + */ +final class Error +{ + private $url; + /** + * @var Response + */ + private $response; + + public function __construct($url, $response) + { + $this->url = $url; + $this->response = $response; + } + + public function code() + { + return $this->response->statusCode; + } + + public function getResponse() + { + return $this->response; + } + + public function message() + { + return $this->response->error; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Http/Header.php b/vendor/qiniu/php-sdk/src/Qiniu/Http/Header.php new file mode 100644 index 0000000..acea1db --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Http/Header.php @@ -0,0 +1,281 @@ + $values) { + $normalizedKey = self::normalizeKey($key); + $normalizedValues = array(); + foreach ($values as $value) { + array_push($normalizedValues, self::normalizeValue($value)); + } + $this->data[$normalizedKey] = $normalizedValues; + } + return $this; + } + + /** + * return origin headers, which is field name case-sensitive + * + * @param string $raw + * + * @return array + */ + public static function parseRawText($raw) + { + $multipleHeaders = explode("\r\n\r\n", trim($raw)); + $headers = array(); + $headerLines = explode("\r\n", end($multipleHeaders)); + foreach ($headerLines as $line) { + $headerLine = trim($line); + $kv = explode(':', $headerLine); + if (count($kv) <= 1) { + continue; + } + // for http2 [Pseudo-Header Fields](https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2.1) + if ($kv[0] == "") { + $fieldName = ":" . $kv[1]; + } else { + $fieldName = $kv[0]; + } + $fieldValue = trim(substr($headerLine, strlen($fieldName . ":"))); + if (isset($headers[$fieldName])) { + array_push($headers[$fieldName], $fieldValue); + } else { + $headers[$fieldName] = array($fieldValue); + } + } + return $headers; + } + + /** + * @param string $raw + * + * @return Header + */ + public static function fromRawText($raw) + { + return new Header(self::parseRawText($raw)); + } + + /** + * @param string $key + * + * @return string + */ + public static function normalizeKey($key) + { + $key = trim($key); + + if (!self::isValidKeyName($key)) { + return $key; + } + + return \Qiniu\ucwords(strtolower($key), '-'); + } + + /** + * @param string|numeric $value + * + * @return string|numeric + */ + public static function normalizeValue($value) + { + if (is_numeric($value)) { + return $value + 0; + } + return trim($value); + } + + /** + * @return array + */ + public function getRawData() + { + return $this->data; + } + + /** + * @param $offset string + * + * @return boolean + */ + #[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x + public function offsetExists($offset) + { + $key = self::normalizeKey($offset); + return isset($this->data[$key]); + } + + /** + * @param $offset string + * + * @return string|null + */ + #[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x + public function offsetGet($offset) + { + $key = self::normalizeKey($offset); + if (isset($this->data[$key]) && count($this->data[$key])) { + return $this->data[$key][0]; + } else { + return null; + } + } + + /** + * @param $offset string + * @param $value string + * + * @return void + */ + #[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x + public function offsetSet($offset, $value) + { + $key = self::normalizeKey($offset); + if (isset($this->data[$key]) && count($this->data[$key]) > 0) { + $this->data[$key][0] = self::normalizeValue($value); + } else { + $this->data[$key] = array(self::normalizeValue($value)); + } + } + + /** + * @return void + */ + #[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x + public function offsetUnset($offset) + { + $key = self::normalizeKey($offset); + unset($this->data[$key]); + } + + /** + * @return \ArrayIterator + */ + #[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x + public function getIterator() + { + $arr = array(); + foreach ($this->data as $k => $v) { + $arr[$k] = $v[0]; + } + return new \ArrayIterator($arr); + } + + /** + * @return int + */ + #[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x + public function count() + { + return count($this->data); + } + + private static $isTokenTable = array( + '!' => true, + '#' => true, + '$' => true, + '%' => true, + '&' => true, + '\'' => true, + '*' => true, + '+' => true, + '-' => true, + '.' => true, + '0' => true, + '1' => true, + '2' => true, + '3' => true, + '4' => true, + '5' => true, + '6' => true, + '7' => true, + '8' => true, + '9' => true, + 'A' => true, + 'B' => true, + 'C' => true, + 'D' => true, + 'E' => true, + 'F' => true, + 'G' => true, + 'H' => true, + 'I' => true, + 'J' => true, + 'K' => true, + 'L' => true, + 'M' => true, + 'N' => true, + 'O' => true, + 'P' => true, + 'Q' => true, + 'R' => true, + 'S' => true, + 'T' => true, + 'U' => true, + 'W' => true, + 'V' => true, + 'X' => true, + 'Y' => true, + 'Z' => true, + '^' => true, + '_' => true, + '`' => true, + 'a' => true, + 'b' => true, + 'c' => true, + 'd' => true, + 'e' => true, + 'f' => true, + 'g' => true, + 'h' => true, + 'i' => true, + 'j' => true, + 'k' => true, + 'l' => true, + 'm' => true, + 'n' => true, + 'o' => true, + 'p' => true, + 'q' => true, + 'r' => true, + 's' => true, + 't' => true, + 'u' => true, + 'v' => true, + 'w' => true, + 'x' => true, + 'y' => true, + 'z' => true, + '|' => true, + '~' => true, + ); + + /** + * @param string $str + * + * @return boolean + */ + private static function isValidKeyName($str) + { + for ($i = 0; $i < strlen($str); $i += 1) { + if (!isset(self::$isTokenTable[$str[$i]])) { + return false; + } + } + return true; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Http/Middleware/Middleware.php b/vendor/qiniu/php-sdk/src/Qiniu/Http/Middleware/Middleware.php new file mode 100644 index 0000000..fe8a64c --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Http/Middleware/Middleware.php @@ -0,0 +1,31 @@ + $middlewares + * @param callable(Request): Response $handler + * @return callable(Request): Response + */ +function compose($middlewares, $handler) +{ + $next = $handler; + foreach (array_reverse($middlewares) as $middleware) { + $next = function ($request) use ($middleware, $next) { + return $middleware->send($request, $next); + }; + } + return $next; +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Http/Middleware/RetryDomainsMiddleware.php b/vendor/qiniu/php-sdk/src/Qiniu/Http/Middleware/RetryDomainsMiddleware.php new file mode 100644 index 0000000..829ab87 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Http/Middleware/RetryDomainsMiddleware.php @@ -0,0 +1,76 @@ + backup domains. + */ + private $backupDomains; + + /** + * @var numeric max retry times for each backup domains. + */ + private $maxRetryTimes; + + /** + * @var callable args response and request; returns bool; If true will retry with backup domains. + */ + private $retryCondition; + + /** + * @param array $backupDomains + * @param numeric $maxRetryTimes + */ + public function __construct($backupDomains, $maxRetryTimes = 2, $retryCondition = null) + { + $this->backupDomains = $backupDomains; + $this->maxRetryTimes = $maxRetryTimes; + $this->retryCondition = $retryCondition; + } + + private function shouldRetry($resp, $req) + { + if (is_callable($this->retryCondition)) { + return call_user_func($this->retryCondition, $resp, $req); + } + + return !$resp || $resp->needRetry(); + } + + /** + * @param Request $request + * @param callable(Request): Response $next + * @return Response + */ + public function send($request, $next) + { + $response = null; + $urlComponents = parse_url($request->url); + + foreach (array_merge(array($urlComponents["host"]), $this->backupDomains) as $backupDomain) { + $urlComponents["host"] = $backupDomain; + $request->url = \Qiniu\unparse_url($urlComponents); + $retriedTimes = 0; + + while ($retriedTimes < $this->maxRetryTimes) { + $response = $next($request); + + $retriedTimes += 1; + + if (!$this->shouldRetry($response, $request)) { + return $response; + } + } + } + + if (!$response) { + $response = $next($request); + } + + return $response; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Http/Proxy.php b/vendor/qiniu/php-sdk/src/Qiniu/Http/Proxy.php new file mode 100644 index 0000000..fac6ba1 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Http/Proxy.php @@ -0,0 +1,34 @@ +proxy = $proxy; + $this->proxy_auth = $proxy_auth; + $this->proxy_user_password = $proxy_user_password; + } + + public function makeReqOpt() + { + $reqOpt = new RequestOptions(); + if ($this->proxy !== null) { + $reqOpt->proxy = $this->proxy; + } + if ($this->proxy_auth !== null) { + $reqOpt->proxy_auth = $this->proxy_auth; + } + if ($this->proxy_user_password !== null) { + $reqOpt->proxy_user_password = $this->proxy_user_password; + } + return $reqOpt; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Http/Request.php b/vendor/qiniu/php-sdk/src/Qiniu/Http/Request.php new file mode 100644 index 0000000..5a31bf6 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Http/Request.php @@ -0,0 +1,42 @@ + + */ + public $headers; + + /** + * @var mixed|null + */ + public $body; + + /** + * @var string + */ + public $method; + + /** + * @var RequestOptions + */ + public $opt; + + public function __construct($method, $url, array $headers = array(), $body = null, $opt = null) + { + $this->method = strtoupper($method); + $this->url = $url; + $this->headers = $headers; + $this->body = $body; + if ($opt === null) { + $opt = new RequestOptions(); + } + $this->opt = $opt; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Http/RequestOptions.php b/vendor/qiniu/php-sdk/src/Qiniu/Http/RequestOptions.php new file mode 100644 index 0000000..be0c6d5 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Http/RequestOptions.php @@ -0,0 +1,104 @@ + + */ + public $middlewares; + + public function __construct( + $connection_timeout = null, + $connection_timeout_ms = null, + $timeout = null, + $timeout_ms = null, + $middlewares = array(), + $proxy = null, + $proxy_auth = null, + $proxy_user_password = null + ) { + $this->connection_timeout = $connection_timeout; + $this->connection_timeout_ms = $connection_timeout_ms; + $this->timeout = $timeout; + $this->timeout_ms = $timeout_ms; + $this->proxy = $proxy; + $this->proxy_auth = $proxy_auth; + $this->proxy_user_password = $proxy_user_password; + $this->middlewares = $middlewares; + } + + public function getCurlOpt() + { + $result = array(); + if ($this->connection_timeout != null) { + $result[CURLOPT_CONNECTTIMEOUT] = $this->connection_timeout; + } + if ($this->connection_timeout_ms != null) { + $result[CURLOPT_CONNECTTIMEOUT_MS] = $this->connection_timeout_ms; + } + if ($this->timeout != null) { + $result[CURLOPT_TIMEOUT] = $this->timeout; + } + if ($this->timeout_ms != null) { + $result[CURLOPT_TIMEOUT_MS] = $this->timeout_ms; + } + if ($this->proxy != null) { + $result[CURLOPT_PROXY] = $this->proxy; + } + if ($this->proxy_auth != null) { + $result[CURLOPT_PROXYAUTH] = $this->proxy_auth; + } + if ($this->proxy_user_password != null) { + $result[CURLOPT_PROXYUSERPWD] = $this->proxy_user_password; + } + return $result; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Http/Response.php b/vendor/qiniu/php-sdk/src/Qiniu/Http/Response.php new file mode 100644 index 0000000..cd77903 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Http/Response.php @@ -0,0 +1,220 @@ + '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', + 226 => 'IM Used', + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 303 => 'See Other', + 304 => 'Not Modified', + 305 => 'Use 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 Timeout', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Long', + 415 => 'Unsupported Media Type', + 416 => 'Requested Range Not Satisfiable', + 417 => 'Expectation Failed', + 422 => 'Unprocessable Entity', + 423 => 'Locked', + 424 => 'Failed Dependency', + 425 => 'Reserved for WebDAV advanced collections expired proposal', + 426 => 'Upgrade required', + 428 => 'Precondition Required', + 429 => 'Too Many Requests', + 431 => 'Request Header Fields Too Large', + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Timeout', + 505 => 'HTTP Version Not Supported', + 506 => 'Variant Also Negotiates (Experimental)', + 507 => 'Insufficient Storage', + 508 => 'Loop Detected', + 510 => 'Not Extended', + 511 => 'Network Authentication Required', + ); + + /** + * @param int $code 状态码 + * @param double $duration 请求时长 + * @param array $headers 响应头部 + * @param string $body 响应内容 + * @param string $error 错误描述 + */ + public function __construct($code, $duration, array $headers = array(), $body = null, $error = null) + { + $this->statusCode = $code; + $this->duration = $duration; + $this->headers = array(); + $this->body = $body; + $this->error = $error; + $this->jsonData = null; + + if ($error !== null) { + return; + } + + foreach ($headers as $k => $vs) { + if (is_array($vs)) { + $this->headers[$k] = $vs[count($vs) - 1]; + } else { + $this->headers[$k] = $vs; + } + } + $this->normalizedHeaders = new Header($headers); + + if ($body === null) { + if ($code >= 400) { + $this->error = self::$statusTexts[$code]; + } + return; + } + if (self::isJson($this->normalizedHeaders)) { + try { + $jsonData = self::bodyJson($body); + if ($code >= 400) { + $this->error = $body; + if ($jsonData['error'] !== null) { + $this->error = $jsonData['error']; + } + } + $this->jsonData = $jsonData; + } catch (\InvalidArgumentException $e) { + $this->error = $body; + if ($code >= 200 && $code < 300) { + $this->error = $e->getMessage(); + } + } + } elseif ($code >= 400) { + $this->error = $body; + } + return; + } + + public function json() + { + return $this->jsonData; + } + + public function headers($normalized = false) + { + if ($normalized) { + return $this->normalizedHeaders; + } + return $this->headers; + } + + public function body() + { + return $this->body; + } + + private static function bodyJson($body) + { + return \Qiniu\json_decode((string) $body, true, 512); + } + + public function xVia() + { + $via = $this->normalizedHeaders['X-Via']; + if ($via === null) { + $via = $this->normalizedHeaders['X-Px']; + } + if ($via === null) { + $via = $this->normalizedHeaders['Fw-Via']; + } + return $via; + } + + public function xLog() + { + return $this->normalizedHeaders['X-Log']; + } + + public function xReqId() + { + return $this->normalizedHeaders['X-Reqid']; + } + + public function ok() + { + return $this->statusCode >= 200 && $this->statusCode < 300 && $this->error === null; + } + + public function needRetry() + { + if ($this->statusCode > 0 && $this->statusCode < 500) { + return false; + } + + // https://developer.qiniu.com/fusion/kb/1352/the-http-request-return-a-status-code + if (in_array($this->statusCode, array( + 501, 509, 573, 579, 608, 612, 614, 616, 618, 630, 631, 632, 640, 701 + ))) { + return false; + } + + return true; + } + + private static function isJson($headers) + { + return isset($headers['Content-Type']) && strpos($headers['Content-Type'], 'application/json') === 0; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Processing/ImageUrlBuilder.php b/vendor/qiniu/php-sdk/src/Qiniu/Processing/ImageUrlBuilder.php new file mode 100644 index 0000000..f5575ed --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Processing/ImageUrlBuilder.php @@ -0,0 +1,292 @@ + + */ + public function thumbnail( + $url, + $mode, + $width, + $height, + $format = null, + $interlace = null, + $quality = null, + $ignoreError = 1 + ) { + + // url合法效验 + if (!$this->isUrl($url)) { + return $url; + } + + // 参数合法性效验 + if (!in_array(intval($mode), $this->modeArr, true)) { + return $url; + } + + if (!$width || !$height) { + return $url; + } + + $thumbStr = 'imageView2/' . $mode . '/w/' . $width . '/h/' . $height . '/'; + + // 拼接输出格式 + if (!is_null($format) + && in_array($format, $this->formatArr) + ) { + $thumbStr .= 'format/' . $format . '/'; + } + + // 拼接渐进显示 + if (!is_null($interlace) + && in_array(intval($interlace), array(0, 1), true) + ) { + $thumbStr .= 'interlace/' . $interlace . '/'; + } + + // 拼接图片质量 + if (!is_null($quality) + && intval($quality) >= 0 + && intval($quality) <= 100 + ) { + $thumbStr .= 'q/' . $quality . '/'; + } + + $thumbStr .= 'ignore-error/' . $ignoreError . '/'; + + // 如果有query_string用|线分割实现多参数 + return $url . ($this->hasQuery($url) ? '|' : '?') . $thumbStr; + } + + /** + * 图片水印 + * + * @param string $url 图片链接 + * @param string $image 水印图片链接 + * @param int $dissolve 透明度 + * @param string $gravity 水印位置 + * @param int $dx 横轴边距 + * @param int $dy 纵轴边距 + * @param int $watermarkScale 自适应原图的短边比例 + * @return string + * @link http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html + * @author Sherlock Ren + */ + public function waterImg( + $url, + $image, + $dissolve = 100, + $gravity = 'SouthEast', + $dx = null, + $dy = null, + $watermarkScale = null + ) { + // url合法效验 + if (!$this->isUrl($url)) { + return $url; + } + + $waterStr = 'watermark/1/image/' . \Qiniu\base64_urlSafeEncode($image) . '/'; + + // 拼接水印透明度 + if (is_numeric($dissolve) + && $dissolve <= 100 + ) { + $waterStr .= 'dissolve/' . $dissolve . '/'; + } + + // 拼接水印位置 + if (in_array($gravity, $this->gravityArr, true)) { + $waterStr .= 'gravity/' . $gravity . '/'; + } + + // 拼接横轴边距 + if (!is_null($dx) + && is_numeric($dx) + ) { + $waterStr .= 'dx/' . $dx . '/'; + } + + // 拼接纵轴边距 + if (!is_null($dy) + && is_numeric($dy) + ) { + $waterStr .= 'dy/' . $dy . '/'; + } + + // 拼接自适应原图的短边比例 + if (!is_null($watermarkScale) + && is_numeric($watermarkScale) + && $watermarkScale > 0 + && $watermarkScale < 1 + ) { + $waterStr .= 'ws/' . $watermarkScale . '/'; + } + + // 如果有query_string用|线分割实现多参数 + return $url . ($this->hasQuery($url) ? '|' : '?') . $waterStr; + } + + /** + * 文字水印 + * + * @param string $url 图片链接 + * @param string $text 文字 + * @param string $font 文字字体 + * @param string $fontSize 文字字号 + * @param string $fontColor 文字颜色 + * @param int $dissolve 透明度 + * @param string $gravity 水印位置 + * @param int $dx 横轴边距 + * @param int $dy 纵轴边距 + * @return string + * @link http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html#text-watermark + * @author Sherlock Ren + */ + public function waterText( + $url, + $text, + $font = '黑体', + $fontSize = 0, + $fontColor = null, + $dissolve = 100, + $gravity = 'SouthEast', + $dx = null, + $dy = null + ) { + // url合法效验 + if (!$this->isUrl($url)) { + return $url; + } + + $waterStr = 'watermark/2/text/' + . \Qiniu\base64_urlSafeEncode($text) . '/font/' + . \Qiniu\base64_urlSafeEncode($font) . '/'; + + // 拼接文字大小 + if (is_int($fontSize)) { + $waterStr .= 'fontsize/' . $fontSize . '/'; + } + + // 拼接文字颜色 + if (!is_null($fontColor) + && $fontColor + ) { + $waterStr .= 'fill/' . \Qiniu\base64_urlSafeEncode($fontColor) . '/'; + } + + // 拼接水印透明度 + if (is_numeric($dissolve) + && $dissolve <= 100 + ) { + $waterStr .= 'dissolve/' . $dissolve . '/'; + } + + // 拼接水印位置 + if (in_array($gravity, $this->gravityArr, true)) { + $waterStr .= 'gravity/' . $gravity . '/'; + } + + // 拼接横轴边距 + if (!is_null($dx) + && is_numeric($dx) + ) { + $waterStr .= 'dx/' . $dx . '/'; + } + + // 拼接纵轴边距 + if (!is_null($dy) + && is_numeric($dy) + ) { + $waterStr .= 'dy/' . $dy . '/'; + } + + // 如果有query_string用|线分割实现多参数 + return $url . ($this->hasQuery($url) ? '|' : '?') . $waterStr; + } + + /** + * 效验url合法性 + * + * @param string $url url链接 + * @return string + * @author Sherlock Ren + */ + protected function isUrl($url) + { + $urlArr = parse_url($url); + + return $urlArr['scheme'] + && in_array($urlArr['scheme'], array('http', 'https')) + && $urlArr['host'] + && $urlArr['path']; + } + + /** + * 检测是否有query + * + * @param string $url url链接 + * @return string + * @author Sherlock Ren + */ + protected function hasQuery($url) + { + $urlArr = parse_url($url); + + return !empty($urlArr['query']); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Processing/Operation.php b/vendor/qiniu/php-sdk/src/Qiniu/Processing/Operation.php new file mode 100644 index 0000000..839703c --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Processing/Operation.php @@ -0,0 +1,69 @@ +auth = $auth; + $this->domain = $domain; + $this->token_expire = $token_expire; + $this->proxy = new Proxy($proxy, $proxy_auth, $proxy_user_password); + } + + + /** + * 对资源文件进行处理 + * + * @param string $key 待处理的资源文件名 + * @param string $fops string|array fop操作,多次fop操作以array的形式传入。 + * eg. imageView2/1/w/200/h/200, imageMogr2/thumbnail/!75px + * + * @return array 文件处理后的结果及错误。 + * + * @link http://developer.qiniu.com/docs/v6/api/reference/fop/ + */ + public function execute($key, $fops) + { + $url = $this->buildUrl($key, $fops); + $resp = Client::get($url, array(), $this->proxy->makeReqOpt()); + if (!$resp->ok()) { + return array(null, new Error($url, $resp)); + } + if ($resp->json() !== null) { + return array($resp->json(), null); + } + return array($resp->body, null); + } + + public function buildUrl($key, $fops, $protocol = 'http') + { + if (is_array($fops)) { + $fops = implode('|', $fops); + } + + $url = $protocol . "://$this->domain/$key?$fops"; + if ($this->auth !== null) { + $url = $this->auth->privateDownloadUrl($url, $this->token_expire); + } + + return $url; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Processing/PersistentFop.php b/vendor/qiniu/php-sdk/src/Qiniu/Processing/PersistentFop.php new file mode 100644 index 0000000..97a4ff4 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Processing/PersistentFop.php @@ -0,0 +1,101 @@ +auth = $auth; + if ($config == null) { + $this->config = new Config(); + } else { + $this->config = $config; + } + $this->proxy = new Proxy($proxy, $proxy_auth, $proxy_user_password); + } + + /** + * 对资源文件进行异步持久化处理 + * @param string $bucket 资源所在空间 + * @param string $key 待处理的源文件 + * @param string $fops string|array 待处理的pfop操作,多个pfop操作以array的形式传入。 + * eg. avthumb/mp3/ab/192k, vframe/jpg/offset/7/w/480/h/360 + * @param string $pipeline 资源处理队列 + * @param string $notify_url 处理结果通知地址 + * @param bool $force 是否强制执行一次新的指令 + * + * + * @return array 返回持久化处理的persistentId, 和返回的错误。 + * + * @link http://developer.qiniu.com/docs/v6/api/reference/fop/ + */ + public function execute($bucket, $key, $fops, $pipeline = null, $notify_url = null, $force = false) + { + if (is_array($fops)) { + $fops = implode(';', $fops); + } + $params = array('bucket' => $bucket, 'key' => $key, 'fops' => $fops); + \Qiniu\setWithoutEmpty($params, 'pipeline', $pipeline); + \Qiniu\setWithoutEmpty($params, 'notifyURL', $notify_url); + if ($force) { + $params['force'] = 1; + } + $data = http_build_query($params); + $scheme = "http://"; + if ($this->config->useHTTPS === true) { + $scheme = "https://"; + } + $url = $scheme . Config::API_HOST . '/pfop/'; + $headers = $this->auth->authorization($url, $data, 'application/x-www-form-urlencoded'); + $headers['Content-Type'] = 'application/x-www-form-urlencoded'; + $response = Client::post($url, $data, $headers, $this->proxy->makeReqOpt()); + if (!$response->ok()) { + return array(null, new Error($url, $response)); + } + $r = $response->json(); + $id = $r['persistentId']; + return array($id, null); + } + + public function status($id) + { + $scheme = "http://"; + + if ($this->config->useHTTPS === true) { + $scheme = "https://"; + } + $url = $scheme . Config::API_HOST . "/status/get/prefop?id=$id"; + $response = Client::get($url, array(), $this->proxy->makeReqOpt()); + if (!$response->ok()) { + return array(null, new Error($url, $response)); + } + return array($response->json(), null); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Region.php b/vendor/qiniu/php-sdk/src/Qiniu/Region.php new file mode 100644 index 0000000..220a5a3 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Region.php @@ -0,0 +1,229 @@ +srcUpHosts = $srcUpHosts; + $this->cdnUpHosts = $cdnUpHosts; + $this->rsHost = $rsHost; + $this->rsfHost = $rsfHost; + $this->apiHost = $apiHost; + $this->iovipHost = $iovipHost; + $this->ttl = $ttl; + } + + //华东机房 + public static function regionHuadong() + { + $regionHuadong = new Region( + array("up.qiniup.com"), + array('upload.qiniup.com'), + 'rs-z0.qiniuapi.com', + 'rsf-z0.qiniuapi.com', + 'api.qiniuapi.com', + 'iovip.qbox.me' + ); + return $regionHuadong; + } + + //华东机房内网上传 + public static function qvmRegionHuadong() + { + $qvmRegionHuadong = new Region( + array("free-qvm-z0-xs.qiniup.com"), + 'rs-z0.qiniuapi.com', + 'rsf-z0.qiniuapi.com', + 'api.qiniuapi.com', + 'iovip.qbox.me' + ); + return $qvmRegionHuadong; + } + + //华北机房内网上传 + public static function qvmRegionHuabei() + { + $qvmRegionHuabei = new Region( + array("free-qvm-z1-zz.qiniup.com"), + "rs-z1.qiniuapi.com", + "rsf-z1.qiniuapi.com", + "api-z1.qiniuapi.com", + "iovip-z1.qbox.me" + ); + return $qvmRegionHuabei; + } + + //华北机房 + public static function regionHuabei() + { + $regionHuabei = new Region( + array('up-z1.qiniup.com'), + array('upload-z1.qiniup.com'), + "rs-z1.qiniuapi.com", + "rsf-z1.qiniuapi.com", + "api-z1.qiniuapi.com", + "iovip-z1.qbox.me" + ); + + return $regionHuabei; + } + + //华南机房 + public static function regionHuanan() + { + $regionHuanan = new Region( + array('up-z2.qiniup.com'), + array('upload-z2.qiniup.com'), + "rs-z2.qiniuapi.com", + "rsf-z2.qiniuapi.com", + "api-z2.qiniuapi.com", + "iovip-z2.qbox.me" + ); + return $regionHuanan; + } + + //华东2 机房 + public static function regionHuadong2() + { + return new Region( + array('up-cn-east-2.qiniup.com'), + array('upload-cn-east-2.qiniup.com'), + "rs-cn-east-2.qiniuapi.com", + "rsf-cn-east-2.qiniuapi.com", + "api-cn-east-2.qiniuapi.com", + "iovip-cn-east-2.qiniuio.com" + ); + } + + //北美机房 + public static function regionNorthAmerica() + { + //北美机房 + $regionNorthAmerica = new Region( + array('up-na0.qiniup.com'), + array('upload-na0.qiniup.com'), + "rs-na0.qiniuapi.com", + "rsf-na0.qiniuapi.com", + "api-na0.qiniuapi.com", + "iovip-na0.qbox.me" + ); + return $regionNorthAmerica; + } + + //新加坡机房 + public static function regionSingapore() + { + //新加坡机房 + $regionSingapore = new Region( + array('up-as0.qiniup.com'), + array('upload-as0.qiniup.com'), + "rs-as0.qiniuapi.com", + "rsf-as0.qiniuapi.com", + "api-as0.qiniuapi.com", + "iovip-as0.qbox.me" + ); + return $regionSingapore; + } + + /* + * GET /v4/query?ak=&bucket= + * @param string $ak + * @param string $bucket + * @param string $ucHost|null + * @param array $backupUcHosts + * @param int $retryTimes + * @param RequestOptions|null $reqOpt + * @return Response + **/ + public static function queryRegion( + $ak, + $bucket, + $ucHost = null, + $backupUcHosts = array(), + $retryTimes = 2, + $reqOpt = null + ) { + $region = new Region(); + if (!$ucHost) { + $ucHost = "https://" . Config::QUERY_REGION_HOST; + } + $url = $ucHost . '/v4/query' . "?ak=$ak&bucket=$bucket"; + if ($reqOpt == null) { + $reqOpt = new RequestOptions(); + } + $reqOpt->middlewares = array( + new RetryDomainsMiddleware( + $backupUcHosts, + $retryTimes + ) + ); + $ret = Client::get($url, array(), $reqOpt); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + if (!is_array($r["hosts"]) || count($r["hosts"]) == 0) { + return array(null, new Error($url, $ret)); + } + + // parse region; + $regionHost = $r["hosts"][0]; + $region->cdnUpHosts = array_merge($region->cdnUpHosts, $regionHost['up']['domains']); + $region->srcUpHosts = array_merge($region->srcUpHosts, $regionHost['up']['domains']); + + // set specific hosts + $region->iovipHost = $regionHost['io']['domains'][0]; + if (isset($regionHost['rs']['domains']) && count($regionHost['rs']['domains']) > 0) { + $region->rsHost = $regionHost['rs']['domains'][0]; + } else { + $region->rsHost = Config::RS_HOST; + } + if (isset($regionHost['rsf']['domains']) && count($regionHost['rsf']['domains']) > 0) { + $region->rsfHost = $regionHost['rsf']['domains'][0]; + } else { + $region->rsfHost = Config::RSF_HOST; + } + if (isset($regionHost['api']['domains']) && count($regionHost['api']['domains']) > 0) { + $region->apiHost = $regionHost['api']['domains'][0]; + } else { + $region->apiHost = Config::API_HOST; + } + + // set ttl + $region->ttl = $regionHost['ttl']; + + return $region; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Rtc/AppClient.php b/vendor/qiniu/php-sdk/src/Qiniu/Rtc/AppClient.php new file mode 100644 index 0000000..3f245db --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Rtc/AppClient.php @@ -0,0 +1,236 @@ +auth = $auth; + $this->baseURL = sprintf("%s/%s/apps", Config::RTCAPI_HOST, Config::RTCAPI_VERSION); + $this->proxy = new Proxy($proxy, $proxy_auth, $proxy_user_password); + } + + /** + * 创建应用 + * + * @param string $hub 绑定的直播 hub + * @param string $title app 的名称 注意,Title 不是唯一标识,重复 create 动作将生成多个 app + * @param int $maxUsers 连麦房间支持的最大在线人数 + * @param bool $noAutoKickUser 禁止自动踢人(抢流),默认为 false + * @return array + * @link https://doc.qnsdk.com/rtn/docs/server_overview#2_1 + */ + public function createApp($hub, $title, $maxUsers = null, $noAutoKickUser = null) + { + $params = array(); + $params['hub'] = $hub; + $params['title'] = $title; + if (!empty($maxUsers)) { + $params['maxUsers'] = $maxUsers; + } + if ($noAutoKickUser !== null) { + $params['noAutoKickUser'] = $noAutoKickUser; + } + $body = json_encode($params); + return $this->post($this->baseURL, $body); + } + + /** + * 更新一个应用的配置信息 + * + * @param string $appId app 的唯一标识,创建的时候由系统生成 + * @param string $hub app 的名称,可选 + * @param string $title 绑定的直播 hub,可选,用于合流后 rtmp 推流 + * @param int $maxUsers 连麦房间支持的最大在线人数,可选 + * @param bool $noAutoKickUser 禁止自动踢人,可选 + * @param null $mergePublishRtmp 连麦合流转推 RTMP 的配置,可选择。其详细配置可以参考文档 + * @return array + * @link https://doc.qnsdk.com/rtn/docs/server_overview#2_1 + */ + public function updateApp($appId, $hub, $title, $maxUsers = null, $noAutoKickUser = null, $mergePublishRtmp = null) + { + $url = $this->baseURL . '/' . $appId; + $params = array(); + $params['hub'] = $hub; + $params['title'] = $title; + if (!empty($maxUsers)) { + $params['maxUsers'] = $maxUsers; + } + if ($noAutoKickUser !== null) { + $params['noAutoKickUser'] = $noAutoKickUser; + } + if (!empty($mergePublishRtmp)) { + $params['mergePublishRtmp'] = $mergePublishRtmp; + } + $body = json_encode($params); + return $this->post($url, $body); + } + + /** + * 获取应用信息 + * + * @param string $appId + * @return array + * @link https://doc.qnsdk.com/rtn/docs/server_overview#2_1 + */ + public function getApp($appId) + { + $url = $this->baseURL . '/' . $appId; + return $this->get($url); + } + + /** + * 删除应用 + * + * @param string $appId app 的唯一标识,创建的时候由系统生成 + * @return array + * @link https://doc.qnsdk.com/rtn/docs/server_overview#2_1 + */ + public function deleteApp($appId) + { + $url = $this->baseURL . '/' . $appId; + return $this->delete($url); + } + + /** + * 获取房间内用户列表 + * + * @param string $appId app 的唯一标识,创建的时候由系统生成 + * @param string $roomName 操作所查询的连麦房间 + * @return array + * @link https://doc.qnsdk.com/rtn/docs/server_overview#2_2 + */ + public function listUser($appId, $roomName) + { + $url = sprintf("%s/%s/rooms/%s/users", $this->baseURL, $appId, $roomName); + return $this->get($url); + } + + /** + * 指定一个用户踢出房间 + * + * @param string $appId app 的唯一标识,创建的时候由系统生成 + * @param string $roomName 连麦房间 + * @param string $userId 操作所剔除的用户 + * @return mixed + * @link https://doc.qnsdk.com/rtn/docs/server_overview#2_2 + */ + public function kickUser($appId, $roomName, $userId) + { + $url = sprintf("%s/%s/rooms/%s/users/%s", $this->baseURL, $appId, $roomName, $userId); + return $this->delete($url); + } + + /** + * 停止一个房间的合流转推 + * + * @param string $appId + * @param string $roomName + * @return array + * @link https://doc.qnsdk.com/rtn/docs/server_overview#2_2 + */ + public function stopMerge($appId, $roomName) + { + $url = sprintf("%s/%s/rooms/%s/merge", $this->baseURL, $appId, $roomName); + return $this->delete($url); + } + + /** + * 获取应用中活跃房间 + * + * @param string $appId 连麦房间所属的 app + * @param null $prefix 所查询房间名的前缀索引,可以为空。 + * @param int $offset 分页查询的位移标记 + * @param int $limit 此次查询的最大长度 + * @return array + * @link https://doc.qnsdk.com/rtn/docs/server_overview#2_2 + */ + public function listActiveRooms($appId, $prefix = null, $offset = null, $limit = null) + { + $query = array(); + if (isset($prefix)) { + $query['prefix'] = $prefix; + } + if (isset($offset)) { + $query['offset'] = $offset; + } + if (isset($limit)) { + $query['limit'] = $limit; + } + if (isset($query) && !empty($query)) { + $query = '?' . http_build_query($query); + $url = sprintf("%s/%s/rooms%s", $this->baseURL, $appId, $query); + } else { + $url = sprintf("%s/%s/rooms", $this->baseURL, $appId); + } + return $this->get($url); + } + + /** + * 生成加入房间的令牌 + * + * @param string $appId app 的唯一标识,创建的时候由系统生成 + * @param string $roomName 房间名称,需满足规格 ^[a-zA-Z0-9_-]{3,64}$ + * @param string $userId 请求加入房间的用户 ID,需满足规格 ^[a-zA-Z0-9_-]{3,50}$ + * @param int $expireAt 鉴权的有效时间,传入以秒为单位的64位 Unix 绝对时间 + * @param string $permission 该用户的房间管理权限,"admin" 或 "user",默认为 "user" + * @return string + * @link https://doc.qnsdk.com/rtn/docs/server_overview#1 + */ + public function appToken($appId, $roomName, $userId, $expireAt, $permission) + { + $params = array(); + $params['appId'] = $appId; + $params['userId'] = $userId; + $params['roomName'] = $roomName; + $params['permission'] = $permission; + $params['expireAt'] = $expireAt; + $appAccessString = json_encode($params); + return $this->auth->signWithData($appAccessString); + } + + private function get($url, $cType = null) + { + $rtcToken = $this->auth->authorizationV2($url, "GET", null, $cType); + $rtcToken['Content-Type'] = $cType; + $ret = Client::get($url, $rtcToken, $this->proxy->makeReqOpt()); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + return array($ret->json(), null); + } + + private function delete($url, $contentType = 'application/json') + { + $rtcToken = $this->auth->authorizationV2($url, "DELETE", null, $contentType); + $rtcToken['Content-Type'] = $contentType; + $ret = Client::delete($url, $rtcToken, $this->proxy->makeReqOpt()); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + return array($ret->json(), null); + } + + private function post($url, $body, $contentType = 'application/json') + { + $rtcToken = $this->auth->authorizationV2($url, "POST", $body, $contentType); + $rtcToken['Content-Type'] = $contentType; + $ret = Client::post($url, $body, $rtcToken, $this->proxy->makeReqOpt()); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + return array($r, null); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Sms/Sms.php b/vendor/qiniu/php-sdk/src/Qiniu/Sms/Sms.php new file mode 100644 index 0000000..c96409b --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Sms/Sms.php @@ -0,0 +1,382 @@ +auth = $auth; + $this->baseURL = sprintf("%s/%s/", Config::SMS_HOST, Config::SMS_VERSION); + $this->proxy = new Proxy($proxy, $proxy_auth, $proxy_user_password); + } + + /** + * 创建签名 + * + * @param string $signature 签名 + * @param string $source 签名来源,申请签名时必须指定签名来源 + * @param string $pics 签名对应的资质证明图片进行 base64 编码格式转换后的字符串,可选 + * @return array + * + * @link https://developer.qiniu.com/sms/api/5844/sms-api-create-signature + */ + public function createSignature($signature, $source, $pics = null) + { + $params = array(); + $params['signature'] = $signature; + $params['source'] = $source; + if (!empty($pics)) { + $params['pics'] = array($this->imgToBase64($pics)); + } + $body = json_encode($params); + $url = $this->baseURL . 'signature'; + return $this->post($url, $body); + } + + /** + * 编辑签名 + * + * @param string $id 签名 ID + * @param string $signature 签名 + * @param string $source 签名来源 + * @param string $pics 签名对应的资质证明图片进行 base64 编码格式转换后的字符串,可选 + * @return array + * @link https://developer.qiniu.com/sms/api/5890/sms-api-edit-signature + */ + public function updateSignature($id, $signature, $source, $pics = null) + { + $params = array(); + $params['signature'] = $signature; + $params['source'] = $source; + if (!empty($pics)) { + $params['pics'] = array($this->imgToBase64($pics)); + } + $body = json_encode($params); + $url = $this->baseURL . 'signature/' . $id; + return $this->PUT($url, $body); + } + + /** + * 列出签名 + * + * @param string $audit_status 审核状态:"passed"(通过), "rejected"(未通过), "reviewing"(审核中) + * @param int $page 页码。默认为 1 + * @param int $page_size 分页大小。默认为 20 + * @return array + * @link https://developer.qiniu.com/sms/api/5889/sms-api-query-signature + */ + public function querySignature($audit_status = null, $page = 1, $page_size = 20) + { + + $url = sprintf( + "%s?audit_status=%s&page=%s&page_size=%s", + $this->baseURL . 'signature', + $audit_status, + $page, + $page_size + ); + return $this->get($url); + } + + /** + * 查询单个签名 + * + * @param string $signature_id + * @return array + * @link https://developer.qiniu.com/sms/api/5970/query-a-single-signature + */ + public function checkSingleSignature($signature_id) + { + + $url = sprintf( + "%s/%s", + $this->baseURL . 'signature', + $signature_id + ); + return $this->get($url); + } + + /** + * 删除签名 + * + * @param string $signature_id 签名 ID + * @return array + * @link https://developer.qiniu.com/sms/api/5891/sms-api-delete-signature + */ + public function deleteSignature($signature_id) + { + $url = $this->baseURL . 'signature/' . $signature_id; + return $this->delete($url); + } + + /** + * 创建模板 + * + * @param string $name 模板名称 + * @param string $template 模板内容 可设置自定义变量,发送短信时候使用,参考:${code} + * @param string $type notification:通知类,verification:验证码,marketing:营销类,voice:语音类 + * @param string $description 申请理由简述 + * @param string $signature_id 已经审核通过的签名 + * @return array array + * @link https://developer.qiniu.com/sms/api/5893/sms-api-create-template + */ + public function createTemplate( + $name, + $template, + $type, + $description, + $signature_id + ) { + $params = array(); + $params['name'] = $name; + $params['template'] = $template; + $params['type'] = $type; + $params['description'] = $description; + $params['signature_id'] = $signature_id; + + $body = json_encode($params); + $url = $this->baseURL . 'template'; + return $this->post($url, $body); + } + + /** + * 列出模板 + * + * @param string $audit_status 审核状态:passed (通过), rejected (未通过), reviewing (审核中) + * @param int $page 页码。默认为 1 + * @param int $page_size 分页大小。默认为 20 + * @return array + * @link https://developer.qiniu.com/sms/api/5894/sms-api-query-template + */ + public function queryTemplate($audit_status = null, $page = 1, $page_size = 20) + { + + $url = sprintf( + "%s?audit_status=%s&page=%s&page_size=%s", + $this->baseURL . 'template', + $audit_status, + $page, + $page_size + ); + return $this->get($url); + } + + /** + * 查询单个模版 + * + * @param string $template_id 模版ID + * @return array + * @link https://developer.qiniu.com/sms/api/5969/query-a-single-template + */ + public function querySingleTemplate($template_id) + { + + $url = sprintf( + "%s/%s", + $this->baseURL . 'template', + $template_id + ); + return $this->get($url); + } + + /** + * 编辑模板 + * + * @param string $id 模板 ID + * @param string $name 模板名称 + * @param string $template 模板内容 + * @param string $description 申请理由简述 + * @param string $signature_id 已经审核通过的签名 ID + * @return array + * @link https://developer.qiniu.com/sms/api/5895/sms-api-edit-template + */ + public function updateTemplate( + $id, + $name, + $template, + $description, + $signature_id + ) { + $params = array(); + $params['name'] = $name; + $params['template'] = $template; + $params['description'] = $description; + $params['signature_id'] = $signature_id; + $body = json_encode($params); + $url = $this->baseURL . 'template/' . $id; + return $this->PUT($url, $body); + } + + /** + * 删除模板 + * + * @param string $template_id 模板 ID + * @return array + * @link https://developer.qiniu.com/sms/api/5896/sms-api-delete-template + */ + public function deleteTemplate($template_id) + { + $url = $this->baseURL . 'template/' . $template_id; + return $this->delete($url); + } + + /** + * 发送短信 + * + * @param string $template_id 模板 ID + * @param array $mobiles 手机号 + * @param array $parameters 自定义模板变量,变量设置在创建模板时,参数template指定 + * @return array + * @link https://developer.qiniu.com/sms/api/5897/sms-api-send-message + */ + public function sendMessage($template_id, $mobiles, $parameters = null) + { + $params = array(); + $params['template_id'] = $template_id; + $params['mobiles'] = $mobiles; + if (!empty($parameters)) { + $params['parameters'] = $parameters; + } + $body = json_encode($params); + $url = $this->baseURL . 'message'; + return $this->post($url, $body); + } + + /** + * 查询发送记录 + * + * @param string $job_id 发送任务返回的 id + * @param string $message_id 单条短信发送接口返回的 id + * @param string $mobile 接收短信的手机号码 + * @param string $status sending: 发送中,success: 发送成功,failed: 发送失败,waiting: 等待发送 + * @param string $template_id 模版 id + * @param string $type marketing:营销,notification:通知,verification:验证码,voice:语音 + * @param string $start 开始时间,timestamp,例如: 1563280448 + * @param int $end 结束时间,timestamp,例如: 1563280471 + * @param int $page 页码,默认为 1 + * @param int $page_size 每页返回的数据条数,默认20,最大200 + * @return array + * @link https://developer.qiniu.com/sms/api/5852/query-send-sms + */ + public function querySendSms( + $job_id = null, + $message_id = null, + $mobile = null, + $status = null, + $template_id = null, + $type = null, + $start = null, + $end = null, + $page = 1, + $page_size = 20 + ) { + $query = array(); + \Qiniu\setWithoutEmpty($query, 'job_id', $job_id); + \Qiniu\setWithoutEmpty($query, 'message_id', $message_id); + \Qiniu\setWithoutEmpty($query, 'mobile', $mobile); + \Qiniu\setWithoutEmpty($query, 'status', $status); + \Qiniu\setWithoutEmpty($query, 'template_id', $template_id); + \Qiniu\setWithoutEmpty($query, 'type', $type); + \Qiniu\setWithoutEmpty($query, 'start', $start); + \Qiniu\setWithoutEmpty($query, 'end', $end); + \Qiniu\setWithoutEmpty($query, 'page', $page); + \Qiniu\setWithoutEmpty($query, 'page_size', $page_size); + + $url = $this->baseURL . 'messages?' . http_build_query($query); + return $this->get($url); + } + + + public function imgToBase64($img_file) + { + $img_base64 = ''; + if (file_exists($img_file)) { + $app_img_file = $img_file; // 图片路径 + $img_info = getimagesize($app_img_file); // 取得图片的大小,类型等 + $fp = fopen($app_img_file, "r"); // 图片是否可读权限 + if ($fp) { + $filesize = filesize($app_img_file); + if ($filesize > 5 * 1024 * 1024) { + die("pic size < 5M !"); + } + $img_type = null; + $content = fread($fp, $filesize); + $file_content = chunk_split(base64_encode($content)); // base64编码 + switch ($img_info[2]) { //判读图片类型 + case 1: + $img_type = 'gif'; + break; + case 2: + $img_type = 'jpg'; + break; + case 3: + $img_type = 'png'; + break; + } + //合成图片的base64编码 + $img_base64 = 'data:image/' . $img_type . ';base64,' . $file_content; + } + fclose($fp); + } + + return $img_base64; + } + + private function get($url, $contentType = 'application/x-www-form-urlencoded') + { + $headers = $this->auth->authorizationV2($url, "GET", null, $contentType); + $headers['Content-Type'] = $contentType; + $ret = Client::get($url, $headers, $this->proxy->makeReqOpt()); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + return array($ret->json(), null); + } + + private function delete($url, $contentType = 'application/json') + { + $headers = $this->auth->authorizationV2($url, "DELETE", null, $contentType); + $headers['Content-Type'] = $contentType; + $ret = Client::delete($url, $headers, $this->proxy->makeReqOpt()); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + return array($ret->json(), null); + } + + private function post($url, $body, $contentType = 'application/json') + { + $headers = $this->auth->authorizationV2($url, "POST", $body, $contentType); + + $headers['Content-Type'] = $contentType; + $ret = Client::post($url, $body, $headers, $this->proxy->makeReqOpt()); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + return array($r, null); + } + + private function PUT($url, $body, $contentType = 'application/json') + { + $headers = $this->auth->authorizationV2($url, "PUT", $body, $contentType); + $headers['Content-Type'] = $contentType; + $ret = Client::put($url, $body, $headers, $this->proxy->makeReqOpt()); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + return array($r, null); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Storage/ArgusManager.php b/vendor/qiniu/php-sdk/src/Qiniu/Storage/ArgusManager.php new file mode 100644 index 0000000..5f5e554 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Storage/ArgusManager.php @@ -0,0 +1,131 @@ +auth = $auth; + if ($config == null) { + $this->config = new Config(); + } else { + $this->config = $config; + } + $this->proxy = new Proxy($proxy, $proxy_auth, $proxy_user_password); + } + + /** + * 视频审核 + * + * @param string $body body信息 + * + * @return array 成功返回NULL,失败返回对象Qiniu\Http\Error + * @link https://developer.qiniu.com/censor/api/5620/video-censor + */ + public function censorVideo($body) + { + $path = '/v3/video/censor'; + + return $this->arPost($path, $body); + } + + + /** + * 图片审核 + * + * @param string $body + * + * @return array 成功返回NULL,失败返回对象Qiniu\Http\Error + * @link https://developer.qiniu.com/censor/api/5588/image-censor + */ + public function censorImage($body) + { + $path = '/v3/image/censor'; + + return $this->arPost($path, $body); + } + + /** + * 查询视频审核结果 + * + * @param string $jobid 任务ID + * @return array + * @link https://developer.qiniu.com/censor/api/5620/video-censor + */ + public function censorStatus($jobid) + { + $scheme = "http://"; + + if ($this->config->useHTTPS === true) { + $scheme = "https://"; + } + $url = $scheme . Config::ARGUS_HOST . "/v3/jobs/video/$jobid"; + $response = $this->get($url); + if (!$response->ok()) { + print("statusCode: " . $response->statusCode); + return array(null, new Error($url, $response)); + } + return array($response->json(), null); + } + + private function getArHost() + { + $scheme = "http://"; + if ($this->config->useHTTPS === true) { + $scheme = "https://"; + } + return $scheme . Config::ARGUS_HOST; + } + + private function arPost($path, $body = null) + { + $url = $this->getArHost() . $path; + return $this->post($url, $body); + } + + private function get($url) + { + $headers = $this->auth->authorizationV2($url, 'GET'); + + return Client::get($url, $headers, $this->proxy->makeReqOpt()); + } + + private function post($url, $body) + { + $headers = $this->auth->authorizationV2($url, 'POST', $body, 'application/json'); + $headers['Content-Type'] = 'application/json'; + $ret = Client::post($url, $body, $headers, $this->proxy->makeReqOpt()); + if (!$ret->ok()) { + print("statusCode: " . $ret->statusCode); + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + if (strstr($url, "video")) { + $jobid = $r['job']; + return array($jobid, null); + } + return array($r, null); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Storage/BucketManager.php b/vendor/qiniu/php-sdk/src/Qiniu/Storage/BucketManager.php new file mode 100644 index 0000000..bfca4fc --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Storage/BucketManager.php @@ -0,0 +1,1324 @@ +auth = $auth; + if ($config == null) { + $this->config = new Config(); + } else { + $this->config = $config; + } + $this->proxy = new Proxy($proxy, $proxy_auth, $proxy_user_password); + } + + /** + * 获取指定账号下所有的空间名 + * + * @param bool $shared 指定共享空间,rw:读写权限空间,rd:读权限空间 + * @return array 包含所有空间名 + */ + public function buckets($shared = true) + { + $includeShared = "false"; + if ($shared === true) { + $includeShared = "true"; + } + return $this->getV2($this->config->getUcHost() . '/buckets?shared=' . $includeShared); + } + + /** + * 列举空间,返回bucket列表 + * + * @param string $region 区域 + * @param string $line + * @param string $shared 指定共享空间,rw:读写权限空间,rd:读权限空间 + * @return array + */ + public function listbuckets( + $region = null, + $line = 'false', + $shared = 'false' + ) { + $path = '/v3/buckets?region=' . $region . '&line=' . $line . '&shared=' . $shared; + return $this->ucPost($path); + } + + /** + * 创建空间 + * + * @param string $name 创建的空间名 + * @param string $region 创建的区域,默认华东 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1382/mkbucketv3 + */ + public function createBucket($name, $region = 'z0') + { + $path = '/mkbucketv3/' . $name . '/region/' . $region; + return $this->postV2($this->config->getUcHost() . $path, null); + } + + /** + * 删除空间 + * + * @param string $name 需要删除的目标空间名 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1601/drop-bucket + */ + public function deleteBucket($name) + { + $path = '/drop/' . $name; + return $this->postV2($this->config->getUcHost() . $path, null); + } + + /** + * 获取指定空间绑定的所有的域名 + * + * @param string $bucket 空间名称 + * @return array + */ + public function domains($bucket) + { + return $this->ucGet('/v2/domains?tbl=' . $bucket); + } + + /** + * 获取指定空间的相关信息 + * + * @param string $bucket 空间名称 + * @return array + */ + public function bucketInfo($bucket) + { + $path = '/v2/bucketInfo?bucket=' . $bucket; + return $this->ucPost($path); + } + + /** + * 获取指定zone的空间信息列表 + * + * @param string $region 区域 + * @param string $shared 指定共享空间,rw:读写权限空间,rd:读权限空间 + * @param string $fs 如果为 true,会返回每个空间当前的文件数和存储量(实时数据) + * @return array + */ + public function bucketInfos($region = null, $shared = 'false', $fs = 'false') + { + $path = '/v2/bucketInfos?region=' . $region . '&shared=' . $shared . '&fs=' . $fs; + return $this->ucPost($path); + } + + /** + * 列取空间的文件列表 + * + * @param string $bucket 空间名 + * @param string $prefix 列举前缀 + * @param string $marker 列举标识符 + * @param int $limit 单次列举个数限制 + * @param string $delimiter 指定目录分隔符 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1284/list + */ + public function listFiles( + $bucket, + $prefix = null, + $marker = null, + $limit = 1000, + $delimiter = null + ) { + $query = array('bucket' => $bucket); + \Qiniu\setWithoutEmpty($query, 'prefix', $prefix); + \Qiniu\setWithoutEmpty($query, 'marker', $marker); + \Qiniu\setWithoutEmpty($query, 'limit', $limit); + \Qiniu\setWithoutEmpty($query, 'delimiter', $delimiter); + return $this->rsfGet($bucket, '/list?' . http_build_query($query)); + } + + /** + * 列取空间的文件列表 + * + * @deprecated API 可能返回仅包含 marker,不包含 item 或 dir 的项,请使用 {@link listFiles} + * + * @param string $bucket 空间名 + * @param string $prefix 列举前缀 + * @param string $marker 列举标识符 + * @param int $limit 单次列举个数限制 + * @param string $delimiter 指定目录分隔符 + * @param bool $skipconfirm 是否跳过已删除条目的确认机制 + * + * @return array + * @link http://developer.qiniu.com/docs/v6/api/reference/rs/list.html + */ + public function listFilesv2( + $bucket, + $prefix = null, + $marker = null, + $limit = 1000, + $delimiter = null, + $skipconfirm = true + ) { + $query = array('bucket' => $bucket); + \Qiniu\setWithoutEmpty($query, 'prefix', $prefix); + \Qiniu\setWithoutEmpty($query, 'marker', $marker); + \Qiniu\setWithoutEmpty($query, 'limit', $limit); + \Qiniu\setWithoutEmpty($query, 'delimiter', $delimiter); + \Qiniu\setWithoutEmpty($query, 'skipconfirm', $skipconfirm); + $path = '/v2/list?' . http_build_query($query); + + list($host, $err) = $this->config->getRsfHostV2( + $this->auth->getAccessKey(), + $bucket, + $this->proxy->makeReqOpt() + ); + + if ($err != null) { + return array(null, $err); + } + + $url = $host . $path; + $headers = $this->auth->authorizationV2($url, 'POST', null, 'application/x-www-form-urlencoded'); + $ret = Client::post($url, null, $headers, $this->proxy->makeReqOpt()); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + $r = explode("\n", $ret->body); + array_pop($r); + return array($r, null); + } + + /** + * 增加bucket生命规则 + * + * @param string $bucket + * 空间名 + * @param string $name + * 规则名称 bucket 内唯一,长度小于50,不能为空,只能为字母、数字、下划线 + * @param string $prefix + * 同一个 bucket 里面前缀不能重复 + * @param int $delete_after_days + * 指定上传文件多少天后删除,指定为0表示不删除,大于0表示多少天后删除。 + * 需大于 to_line_after_days + * @param int $to_line_after_days + * 指定文件上传多少天后转低频存储。指定为0表示不转低频存储 + * @param int $to_archive_ir_after_days + * 指定文件上传多少天后转归档直读。指定为0表示不转归档直读 + * @param int $to_archive_after_days + * 指定文件上传多少天后转归档存储。指定为0表示不转归档存储 + * @param int $to_deep_archive_after_days + * 指定文件上传多少天后转深度归档存储。指定为0表示不转深度归档存储 + * @return array + */ + public function bucketLifecycleRule( + $bucket, + $name, + $prefix, + $delete_after_days = null, + $to_line_after_days = null, + $to_archive_after_days = null, + $to_deep_archive_after_days = null, + $to_archive_ir_after_days = null + ) { + $path = '/rules/add'; + $params = array(); + if ($bucket) { + $params['bucket'] = $bucket; + } + if ($name) { + $params['name'] = $name; + } + if ($prefix) { + $params['prefix'] = $prefix; + } + if ($delete_after_days) { + $params['delete_after_days'] = $delete_after_days; + } + if ($to_line_after_days) { + $params['to_line_after_days'] = $to_line_after_days; + } + if ($to_archive_ir_after_days) { + $params['to_archive_ir_after_days'] = $to_archive_ir_after_days; + } + if ($to_archive_after_days) { + $params['to_archive_after_days'] = $to_archive_after_days; + } + if ($to_deep_archive_after_days) { + $params['to_deep_archive_after_days'] = $to_deep_archive_after_days; + } + $data = http_build_query($params); + $info = $this->ucPost($path, $data); + return $info; + } + + /** + * 更新bucket生命规则 + * + * @param string $bucket + * 空间名 + * @param string $name + * 规则名称 bucket 内唯一,长度小于50,不能为空,只能为字母、数字、下划线 + * @param string $prefix + * 同一个 bucket 里面前缀不能重复 + * @param int $delete_after_days + * 指定上传文件多少天后删除,指定为0表示不删除,大于0表示多少天后删除 + * 需大于 to_line_after_days + * @param int $to_line_after_days + * 指定文件上传多少天后转低频存储。指定为0表示不转低频存储 + * @param int $to_archive_ir_after_days + * 指定文件上传多少天后转归档只读。指定为0表示不转归档只读 + * @param int $to_archive_after_days + * 指定文件上传多少天后转归档存储。指定为0表示不转归档存储 + * @param int $to_deep_archive_after_days + * 指定文件上传多少天后转深度归档存储。指定为0表示不转深度归档存储 + * @return array + */ + public function updateBucketLifecycleRule( + $bucket, + $name, + $prefix, + $delete_after_days = null, + $to_line_after_days = null, + $to_archive_after_days = null, + $to_deep_archive_after_days = null, + $to_archive_ir_after_days = null + ) { + $path = '/rules/update'; + $params = array(); + if ($bucket) { + $params['bucket'] = $bucket; + } + if ($name) { + $params['name'] = $name; + } + if ($prefix) { + $params['prefix'] = $prefix; + } + if ($delete_after_days) { + $params['delete_after_days'] = $delete_after_days; + } + if ($to_line_after_days) { + $params['to_line_after_days'] = $to_line_after_days; + } + if ($to_archive_ir_after_days) { + $params['to_archive_ir_after_days'] = $to_archive_ir_after_days; + } + if ($to_archive_after_days) { + $params['to_archive_after_days'] = $to_archive_after_days; + } + if ($to_deep_archive_after_days) { + $params['to_deep_archive_after_days'] = $to_deep_archive_after_days; + } + $data = http_build_query($params); + return $this->ucPost($path, $data); + } + + /** + * 获取bucket生命规则 + * + * @param string $bucket 空间名 + * @return array + */ + public function getBucketLifecycleRules($bucket) + { + $path = '/rules/get?bucket=' . $bucket; + $info = $this->ucGet($path); + return $info; + } + + /** + * 删除bucket生命规则 + * + * @param string $bucket 空间名 + * @param string $name 规则名称 bucket 内唯一,长度小于50,不能为空, + * 只能为字母、数字、下划线() + * @return array + */ + public function deleteBucketLifecycleRule($bucket, $name) + { + $path = '/rules/delete'; + $params = array(); + if ($bucket) { + $params['bucket'] = $bucket; + } + if ($name) { + $params['name'] = $name; + } + $data = http_build_query($params); + $info = $this->ucPost($path, $data); + return $info; + } + + /** + * 增加bucket事件通知规则 + * + * @param string $bucket 空间名 + * @param string $name 规则名称 bucket 内唯一,长度小于50,不能为空, + * 只能为字母、数字、下划线() + * @param string $prefix 同一个 bucket 里面前缀不能重复 + * @param string $suffix 可选,文件配置的后缀 + * @param array $event 事件类型,可以指定多个,包括 put,mkfile,delete,copy,move,append, + * disable,enable,deleteMarkerCreate + * @param string $callbackURL 通知URL,可以指定多个,失败依次重试 + * @param string $access_key 可选,设置的话会对通知请求用对应的ak、sk进行签名 + * @param string $host 可选,通知请求的host + * + * @return array + */ + public function putBucketEvent( + $bucket, + $name, + $prefix, + $suffix, + $event, + $callbackURL, + $access_key = null, + $host = null + ) { + $path = '/events/add'; + $params = array(); + if (!empty($bucket)) { + $params['bucket'] = $bucket; + } + if (!empty($name)) { + $params['name'] = $name; + } + if (!empty($prefix)) { + $params['prefix'] = $prefix; + } + if (!empty($suffix)) { + $params['suffix'] = $suffix; + } + if (!empty($callbackURL)) { + $params['callbackURL'] = $callbackURL; + } + if (!empty($access_key)) { + $params['access_key'] = $access_key; + } + if (!empty($host)) { + $params['host'] = $host; + } + $data = http_build_query($params); + if (!empty($event)) { + $eventpath = ""; + foreach ($event as $key => $value) { + $eventpath .= "&event=$value"; + } + $data .= $eventpath; + } + $info = $this->ucPost($path, $data); + return $info; + } + + /** + * 更新bucket事件通知规则 + * + * @param string $bucket 空间名 + * @param string $name 规则名称 bucket 内唯一,长度小于50,不能为空, + * 只能为字母、数字、下划线() + * @param string $prefix 同一个 bucket 里面前缀不能重复 + * @param string $suffix 可选,文件配置的后缀 + * @param array $event 事件类型,可以指定多个,包括 put,mkfile,delete,copy,move,append,disable, + * enable,deleteMarkerCreate + * @param string $callbackURL 通知URL,可以指定多个,失败依次重试 + * @param string $access_key 可选,设置的话会对通知请求用对应的ak、sk进行签名 + * @param string $host 可选,通知请求的host + * + * @return array + */ + public function updateBucketEvent( + $bucket, + $name, + $prefix, + $suffix, + $event, + $callbackURL, + $access_key = null, + $host = null + ) { + $path = '/events/update'; + $params = array(); + if (!empty($bucket)) { + $params['bucket'] = $bucket; + } + if (!empty($name)) { + $params['name'] = $name; + } + if (!empty($prefix)) { + $params['prefix'] = $prefix; + } + if ($suffix) { + $params['suffix'] = $suffix; + } + if (!empty($event)) { + $params['event'] = $event; + } + if (!empty($callbackURL)) { + $params['callbackURL'] = $callbackURL; + } + if (!empty($access_key)) { + $params['access_key'] = $access_key; + } + if (!empty($host)) { + $params['host'] = $host; + } + $data = http_build_query($params); + if (!empty($event)) { + $eventpath = ""; + foreach ($event as $key => $value) { + $eventpath .= "&event=$value"; + } + $data .= $eventpath; + } + return $this->ucPost($path, $data); + } + + /** + * 获取bucket事件通知规则 + * + * @param string $bucket 空间名 + * @return array + */ + public function getBucketEvents($bucket) + { + $path = '/events/get?bucket=' . $bucket; + return $this->ucGet($path); + } + + /** + * 删除bucket事件通知规则 + * + * @param string $bucket 空间名 + * @param string $name 规则名称bucket内唯一,长度小于50,不能为空,只能为字母、数字、下划线 + * @return array + */ + public function deleteBucketEvent($bucket, $name) + { + $path = '/events/delete'; + $params = array(); + if ($bucket) { + $params['bucket'] = $bucket; + } + if ($name) { + $params['name'] = $name; + } + $data = http_build_query($params); + return $this->ucPost($path, $data); + } + + /** + * 获取bucket的跨域信息 + * + * @param string $bucket 空间名 + * @return array + */ + public function getCorsRules($bucket) + { + $path = '/corsRules/get/' . $bucket; + return $this->ucGet($path); + } + + /** + * 开关原图保护 + * + * @param string $bucket 空间名称 + * @param int $mode mode 为1表示开启原图保护,0表示关闭 + * @return array + */ + public function putBucketAccessStyleMode($bucket, $mode) + { + $path = '/accessMode/' . $bucket . '/mode/' . $mode; + return $this->ucPost($path, null); + } + + /** + * 设置私有属性 + * + * @param string $bucket 空间名称 + * @param int $private private为0表示公开,为1表示私有 + * @return array + */ + public function putBucketAccessMode($bucket, $private) + { + $path = "/private?bucket=$bucket&private=$private"; + return $this->ucPost($path, null); + } + + /** + * 设置 referer 防盗链 + * + * @param string $bucket 空间名称 + * @param int $mode 0:关闭Referer(使用此选项将会忽略以下参数并将恢复默认值); + * 1:设置Referer白名单; 2:设置Referer黑名单 + * @param string $norefer 0:不允许空 Refer 访问; 1:表示允许空Refer访问 + * @param string $pattern 规则字符串 + * @param int $enabled 源站是否支持,默认为0只给CDN配置, 设置为1表示开启源站防盗链 + * @return array + * @link https://developer.qiniu.com/kodo/manual/6093/set-the-hotlinking-prevention + */ + public function putReferAntiLeech($bucket, $mode, $norefer, $pattern, $enabled = 1) + { + $path = "/referAntiLeech?bucket=$bucket&mode=$mode&norefer=$norefer&pattern=$pattern&source_enabled=$enabled"; + return $this->ucPost($path, null); + } + + /** + * 设置Bucket的maxAge + * + * @param string $bucket 空间名称 + * @param int $maxAge maxAge为0或者负数表示为默认值(31536000) + * @return array + */ + public function putBucketMaxAge($bucket, $maxAge) + { + $path = '/maxAge?bucket=' . $bucket . '&maxAge=' . $maxAge; + return $this->ucPost($path, null); + } + + /** + * 设置空间配额 + * + * @param string $bucket 空间名称,不支持授权空间 + * @param string $size 空间存储量配额,参数传入0或不传表示不更改当前配置,传入-1表示取消限额,新创建的空间默认没有限额 + * @param string $count 空间文件数配额,参数含义同 + * @return array + */ + public function putBucketQuota($bucket, $size, $count) + { + $path = '/setbucketquota/' . $bucket . '/size/' . $size . '/count/' . $count; + return $this->apiPost($bucket, $path); + } + + /** + * 获取空间配额 + * + * @param string $bucket 空间名称 + * @return array + */ + public function getBucketQuota($bucket) + { + $path = '/getbucketquota/' . $bucket; + return $this->apiPost($bucket, $path); + } + + /** + * 获取资源的元信息,但不返回文件内容 + * + * @param string $bucket 待获取信息资源所在的空间 + * @param string $key 待获取资源的文件名 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1308/stat + */ + public function stat($bucket, $key) + { + $path = '/stat/' . \Qiniu\entry($bucket, $key); + return $this->rsGet($bucket, $path); + } + + /** + * 删除指定资源 + * + * @param string $bucket 待删除资源所在的空间 + * @param string $key 待删除资源的文件名 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1257/delete + */ + public function delete($bucket, $key) + { + $path = '/delete/' . \Qiniu\entry($bucket, $key); + return $this->rsPost($bucket, $path); + } + + /** + * 给资源进行重命名,本质为move操作。 + * + * @param string $bucket 待操作资源所在空间 + * @param string $oldname 待操作资源文件名 + * @param string $newname 目标资源文件名 + * + * @return array + */ + public function rename($bucket, $oldname, $newname) + { + return $this->move($bucket, $oldname, $bucket, $newname); + } + + /** + * 对资源进行复制。 + * + * @param string $from_bucket 待操作资源所在空间 + * @param string $from_key 待操作资源文件名 + * @param string $to_bucket 目标资源空间名 + * @param string $to_key 目标资源文件名 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1254/copy + */ + public function copy($from_bucket, $from_key, $to_bucket, $to_key, $force = false) + { + $from = \Qiniu\entry($from_bucket, $from_key); + $to = \Qiniu\entry($to_bucket, $to_key); + $path = '/copy/' . $from . '/' . $to; + if ($force === true) { + $path .= '/force/true'; + } + return $this->rsPost($from_bucket, $path); + } + + /** + * 将资源从一个空间到另一个空间 + * + * @param string $from_bucket 待操作资源所在空间 + * @param string $from_key 待操作资源文件名 + * @param string $to_bucket 目标资源空间名 + * @param string $to_key 目标资源文件名 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1288/move + */ + public function move($from_bucket, $from_key, $to_bucket, $to_key, $force = false) + { + $from = \Qiniu\entry($from_bucket, $from_key); + $to = \Qiniu\entry($to_bucket, $to_key); + $path = '/move/' . $from . '/' . $to; + if ($force) { + $path .= '/force/true'; + } + return $this->rsPost($from_bucket, $path); + } + + /** + * 主动修改指定资源的文件元信息 + * + * @param string $bucket 待操作资源所在空间 + * @param string $key 待操作资源文件名 + * @param string $mime 待操作文件目标mimeType + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1252/chgm + */ + public function changeMime($bucket, $key, $mime) + { + $resource = \Qiniu\entry($bucket, $key); + $encode_mime = \Qiniu\base64_urlSafeEncode($mime); + $path = '/chgm/' . $resource . '/mime/' . $encode_mime; + return $this->rsPost($bucket, $path); + } + + + /** + * 修改指定资源的存储类型 + * + * @param string $bucket 待操作资源所在空间 + * @param string $key 待操作资源文件名 + * @param int $fileType 对象存储类型 + * 0 表示标准存储; + * 1 表示低频存储; + * 2 表示归档存储; + * 3 表示深度归档存储; + * 4 表示归档直读存储; + * + * @return array + * @link https://developer.qiniu.com/kodo/api/3710/chtype + */ + public function changeType($bucket, $key, $fileType) + { + $resource = \Qiniu\entry($bucket, $key); + $path = '/chtype/' . $resource . '/type/' . $fileType; + return $this->rsPost($bucket, $path); + } + + /** + * 解冻指定资源的存储类型 + * + * @param string $bucket 待操作资源所在空间 + * @param string $key 待操作资源文件名 + * @param int $freezeAfterDays 解冻有效时长,取值范围 1~7 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/6380/restore-archive + */ + public function restoreAr($bucket, $key, $freezeAfterDays) + { + $resource = \Qiniu\entry($bucket, $key); + $path = '/restoreAr/' . $resource . '/freezeAfterDays/' . $freezeAfterDays; + return $this->rsPost($bucket, $path); + } + + /** + * 修改文件的存储状态,即禁用状态和启用状态间的的互相转换 + * + * @param string $bucket 待操作资源所在空间 + * @param string $key 待操作资源文件名 + * @param int $status 0表示启用;1表示禁用 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/4173/modify-the-file-status + */ + public function changeStatus($bucket, $key, $status) + { + $resource = \Qiniu\entry($bucket, $key); + $path = '/chstatus/' . $resource . '/status/' . $status; + return $this->rsPost($bucket, $path); + } + + /** + * 从指定URL抓取资源,并将该资源存储到指定空间中 + * + * @param string $url 指定的URL + * @param string $bucket 目标资源空间 + * @param string $key 目标资源文件名 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1263/fetch + */ + public function fetch($url, $bucket, $key = null) + { + + $resource = \Qiniu\base64_urlSafeEncode($url); + $to = \Qiniu\entry($bucket, $key); + $path = '/fetch/' . $resource . '/to/' . $to; + + $ak = $this->auth->getAccessKey(); + + + list($ioHost, $err) = $this->config->getIovipHostV2($ak, $bucket, $this->proxy->makeReqOpt()); + if ($err != null) { + return array(null, $err); + } + + $url = $ioHost . $path; + return $this->postV2($url, null); + } + + /** + * 从指定URL异步抓取资源,并将该资源存储到指定空间中 + * + * @param string $url 需要抓取的url + * @param string $bucket 所在区域的bucket + * @param string $host 从指定url下载数据时使用的Host + * @param string $key 文件存储的key + * @param string $md5 文件md5 + * @param string $etag 文件etag + * @param string $callbackurl 回调URL + * @param string $callbackbody 回调Body + * @param string $callbackbodytype 回调Body内容类型,默认为"application/x-www-form-urlencoded" + * @param string $callbackhost 回调时使用的Host + * @param int $file_type 存储文件类型 + * 0:标准存储(默认) + * 1:低频存储 + * 2:归档存储 + * 3:深度归档存储 + * 4:归档直读存储 + * @param bool $ignore_same_key 如果空间中已经存在同名文件则放弃本次抓取 + * @return array + * @link https://developer.qiniu.com/kodo/api/4097/asynch-fetch + */ + public function asynchFetch( + $url, + $bucket, + $host = null, + $key = null, + $md5 = null, + $etag = null, + $callbackurl = null, + $callbackbody = null, + $callbackbodytype = 'application/x-www-form-urlencoded', + $callbackhost = null, + $file_type = 0, + $ignore_same_key = false + ) { + $path = '/sisyphus/fetch'; + + $params = array('url' => $url, 'bucket' => $bucket); + \Qiniu\setWithoutEmpty($params, 'host', $host); + \Qiniu\setWithoutEmpty($params, 'key', $key); + \Qiniu\setWithoutEmpty($params, 'md5', $md5); + \Qiniu\setWithoutEmpty($params, 'etag', $etag); + \Qiniu\setWithoutEmpty($params, 'callbackurl', $callbackurl); + \Qiniu\setWithoutEmpty($params, 'callbackbody', $callbackbody); + \Qiniu\setWithoutEmpty($params, 'callbackbodytype', $callbackbodytype); + \Qiniu\setWithoutEmpty($params, 'callbackhost', $callbackhost); + \Qiniu\setWithoutEmpty($params, 'file_type', $file_type); + \Qiniu\setWithoutEmpty($params, 'ignore_same_key', $ignore_same_key); + $data = json_encode($params); + + return $this->apiPost($bucket, $path, $data); + } + + + /** + * 查询异步第三方资源抓取任务状态 + * + * @param string $zone + * @param string $id + * @return array + * @link https://developer.qiniu.com/kodo/api/4097/asynch-fetch + */ + public function asynchFetchStatus($zone, $id) + { + $scheme = "http://"; + + if ($this->config->useHTTPS === true) { + $scheme = "https://"; + } + + $url = $scheme . "api-" . $zone . ".qiniuapi.com/sisyphus/fetch?id=" . $id; + + list($ret, $err) = $this->getV2($url); + + if ($err != null) { + return array(null, $err); + } + return array($ret, null); + } + + + /** + * 从镜像源站抓取资源到空间中,如果空间中已经存在,则覆盖该资源 + * + * @param string $bucket 待获取资源所在的空间 + * @param string $key 代获取资源文件名 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1293/prefetch + */ + public function prefetch($bucket, $key) + { + $resource = \Qiniu\entry($bucket, $key); + $path = '/prefetch/' . $resource; + + $ak = $this->auth->getAccessKey(); + list($ioHost, $err) = $this->config->getIovipHostV2($ak, $bucket, $this->proxy->makeReqOpt()); + + if ($err != null) { + return array(null, $err); + } + + $url = $ioHost . $path; + return $this->postV2($url, null); + } + + /** + * 在单次请求中进行多个资源管理操作 + * + * @param array $operations 资源管理操作数组 + * + * @return array 每个资源的处理情况,结果类似: + * [ + * { "code" => , "data" => }, + * { "code" => }, + * { "code" => }, + * { "code" => }, + * { "code" => , "data" => { "error": "" } }, + * ... + * ] + * @link http://developer.qiniu.com/docs/v6/api/reference/rs/batch.html + */ + public function batch($operations) + { + $scheme = "http://"; + if ($this->config->useHTTPS === true) { + $scheme = "https://"; + } + $params = 'op=' . implode('&op=', $operations); + $errResp = new Response(0, 0); + if (count($operations) <= 0) { + $errResp->error = 'empty operations'; + return array(null, new Error($scheme . '/batch', $errResp)); + } + $bucket = ''; + foreach ($operations as $op) { + $segments = explode('/', $op); + if (count($segments) < 3) { + continue; + } + list($bucket,) = \Qiniu\decodeEntry($segments[2]); + } + return $this->rsPost($bucket, '/batch', $params); + } + + /** + * 设置文件的生命周期 + * + * @param string $bucket 设置文件生命周期文件所在的空间 + * @param string $key 设置文件生命周期文件的文件名 + * @param int $days 设置该文件多少天后删除,当$days设置为0时表示取消该文件的生命周期 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/update-file-lifecycle + */ + public function deleteAfterDays($bucket, $key, $days) + { + $entry = \Qiniu\entry($bucket, $key); + $path = "/deleteAfterDays/$entry/$days"; + return $this->rsPost($bucket, $path); + } + + /** + * 更新 object 生命周期 + * + * @param string $bucket 空间名 + * @param string $key 目标资源 + * @param int $to_line_after_days 多少天后将文件转为低频存储。 + * -1 表示取消已设置的转低频存储的生命周期规则; + * 0 表示不修改转低频生命周期规则。 + * @param int $to_archive_ir_after_days 多少天后转为归档直读存储。 + * -1 表示取消已设置的转归档直读存储的生命周期规则; + * 0 表示不修改转归档直读生命周期规则。 + * @param int $to_archive_after_days 多少天后将文件转为归档存储。 + * -1 表示取消已设置的转归档存储的生命周期规则; + * 0 表示不修改转归档生命周期规则。 + * @param int $to_deep_archive_after_days 多少天后将文件转为深度归档存储。 + * -1 表示取消已设置的转深度归档存储的生命周期规则; + * 0 表示不修改转深度归档生命周期规则。 + * @param int $delete_after_days 多少天后将文件删除。 + * -1 表示取消已设置的删除存储的生命周期规则; + * 0 表示不修改删除存储的生命周期规则。 + * @return array + */ + public function setObjectLifecycle( + $bucket, + $key, + $to_line_after_days = 0, + $to_archive_after_days = 0, + $to_deep_archive_after_days = 0, + $delete_after_days = 0, + $to_archive_ir_after_days = 0 + ) { + return $this->setObjectLifecycleWithCond( + $bucket, + $key, + null, + $to_line_after_days, + $to_archive_after_days, + $to_deep_archive_after_days, + $delete_after_days, + $to_archive_ir_after_days + ); + } + + /** + * 更新 object 生命周期 + * + * @param string $bucket 空间名 + * @param string $key 目标资源 + * @param int $to_line_after_days 多少天后将文件转为低频存储。 + * 设置为 -1 表示取消已设置的转低频存储的生命周期规则; + * 0 表示不修改转低频生命周期规则。 + * @param int $to_archive_ir_after_days 多少天后将文件转为归档直读存储。 + * 设置为 -1 表示取消已设置的转归档直读存储的生命周期规则; + * 0 表示不修改转归档直读生命周期规则。 + * @param int $to_archive_after_days 多少天后将文件转为归档存储。 + * -1 表示取消已设置的转归档存储的生命周期规则; + * 0 表示不修改转归档生命周期规则。 + * @param int $to_deep_archive_after_days 多少天后将文件转为深度归档存储。 + * -1 表示取消已设置的转深度归档存储的生命周期规则; + * 0 表示不修改转深度归档生命周期规则。 + * @param int $delete_after_days 多少天后将文件删除。 + * -1 表示取消已设置的删除存储的生命周期规则; + * 0 表示不修改删除存储的生命周期规则。 + * @param array $cond 匹配条件,只有条件匹配才会设置成功。 + * 目前支持:hash、mime、fsize、putTime + * @return array + */ + public function setObjectLifecycleWithCond( + $bucket, + $key, + $cond = null, + $to_line_after_days = 0, + $to_archive_after_days = 0, + $to_deep_archive_after_days = 0, + $delete_after_days = 0, + $to_archive_ir_after_days = 0 + ) { + $encodedEntry = \Qiniu\entry($bucket, $key); + $path = '/lifecycle/' . $encodedEntry . + '/toIAAfterDays/' . $to_line_after_days . + '/toArchiveIRAfterDays/' . $to_archive_ir_after_days . + '/toArchiveAfterDays/' . $to_archive_after_days . + '/toDeepArchiveAfterDays/' . $to_deep_archive_after_days . + '/deleteAfterDays/' . $delete_after_days; + if ($cond != null) { + $condStrArr = array(); + foreach ($cond as $key => $value) { + array_push($condStrArr, $key . '=' . $value); + } + $condStr = implode('&', $condStrArr); + $path .= '/cond' . \Qiniu\base64_urlSafeEncode($condStr); + } + return $this->rsPost($bucket, $path); + } + + private function rsfGet($bucket, $path) + { + list($host, $err) = $this->config->getRsfHostV2( + $this->auth->getAccessKey(), + $bucket, + $this->proxy->makeReqOpt() + ); + + if ($err != null) { + return array(null, $err); + } + + return $this->getV2($host . $path); + } + + private function rsGet($bucket, $path) + { + list($host, $err) = $this->config->getRsHostV2( + $this->auth->getAccessKey(), + $bucket, + $this->proxy->makeReqOpt() + ); + + if ($err != null) { + return array(null, $err); + } + + return $this->getV2($host . $path); + } + + private function rsPost($bucket, $path, $body = null) + { + list($host, $err) = $this->config->getRsHostV2( + $this->auth->getAccessKey(), + $bucket, + $this->proxy->makeReqOpt() + ); + + if ($err != null) { + return array(null, $err); + } + + return $this->postV2($host . $path, $body); + } + + private function apiGet($bucket, $path) + { + list($host, $err) = $this->config->getApiHostV2( + $this->auth->getAccessKey(), + $bucket, + $this->proxy->makeReqOpt() + ); + + if ($err != null) { + return array(null, $err); + } + + return $this->getV2($host . $path); + } + + private function apiPost($bucket, $path, $body = null) + { + + list($host, $err) = $this->config->getApiHostV2( + $this->auth->getAccessKey(), + $bucket, + $this->proxy->makeReqOpt() + ); + + if ($err != null) { + return array(null, $err); + } + + return $this->postV2($host . $path, $body); + } + + private function ucGet($path) + { + $url = $this->config->getUcHost() . $path; + return $this->getV2($url); + } + + private function ucPost($path, $body = null) + { + $url = $this->config->getUcHost() . $path; + return $this->postV2($url, $body); + } + + private function getV2($url) + { + $headers = $this->auth->authorizationV2($url, 'GET', null, 'application/x-www-form-urlencoded'); + $ret = Client::get($url, $headers, $this->proxy->makeReqOpt()); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + return array($ret->json(), null); + } + + private function postV2($url, $body) + { + $headers = $this->auth->authorizationV2($url, 'POST', $body, 'application/x-www-form-urlencoded'); + $ret = Client::post($url, $body, $headers, $this->proxy->makeReqOpt()); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + return array($r, null); + } + + public static function buildBatchCopy($source_bucket, $key_pairs, $target_bucket, $force) + { + return self::twoKeyBatch('/copy', $source_bucket, $key_pairs, $target_bucket, $force); + } + + + public static function buildBatchRename($bucket, $key_pairs, $force) + { + return self::buildBatchMove($bucket, $key_pairs, $bucket, $force); + } + + + public static function buildBatchMove($source_bucket, $key_pairs, $target_bucket, $force) + { + return self::twoKeyBatch('/move', $source_bucket, $key_pairs, $target_bucket, $force); + } + + + public static function buildBatchDelete($bucket, $keys) + { + return self::oneKeyBatch('/delete', $bucket, $keys); + } + + + public static function buildBatchStat($bucket, $keys) + { + return self::oneKeyBatch('/stat', $bucket, $keys); + } + + public static function buildBatchDeleteAfterDays($bucket, $key_day_pairs) + { + $data = array(); + foreach ($key_day_pairs as $key => $day) { + array_push($data, '/deleteAfterDays/' . \Qiniu\entry($bucket, $key) . '/' . $day); + } + return $data; + } + + /** + * @param string $bucket 空间名 + * @param array $keys 目标资源 + * @param int $to_line_after_days 多少天后将文件转为低频存储。 + * -1 表示取消已设置的转低频存储的生命周期规则; + * 0 表示不修改转低频生命周期规则。 + * @param int $to_archive_ir_after_days 多少天后将文件转为归档直读。 + * -1 表示取消已设置的转归档只读的生命周期规则; + * 0 表示不修改转归档只读周期规则。 + * @param int $to_archive_after_days 多少天后将文件转为归档存储。 + * -1 表示取消已设置的转归档存储的生命周期规则; + * 0 表示不修改转归档生命周期规则。 + * @param int $to_deep_archive_after_days 多少天后将文件转为深度归档存储。 + * -1 表示取消已设置的转深度归档存储的生命周期规则; + * 0 表示不修改转深度归档生命周期规则。 + * @param int $delete_after_days 多少天后将文件删除。 + * -1 表示取消已设置的删除存储的生命周期规则; + * 0 表示不修改删除存储的生命周期规则。 + * + * @retrun array + */ + public static function buildBatchSetObjectLifecycle( + $bucket, + $keys, + $to_line_after_days, + $to_archive_after_days, + $to_deep_archive_after_days, + $delete_after_days, + $to_archive_ir_after_days = 0 + ) { + $result = array(); + foreach ($keys as $key) { + $encodedEntry = \Qiniu\entry($bucket, $key); + $op = '/lifecycle/' . $encodedEntry . + '/toIAAfterDays/' . $to_line_after_days . + '/toArchiveIRAfterDays/' . $to_archive_ir_after_days . + '/toArchiveAfterDays/' . $to_archive_after_days . + '/toDeepArchiveAfterDays/' . $to_deep_archive_after_days . + '/deleteAfterDays/' . $delete_after_days; + array_push($result, $op); + } + return $result; + } + + public static function buildBatchChangeMime($bucket, $key_mime_pairs) + { + $data = array(); + foreach ($key_mime_pairs as $key => $mime) { + array_push($data, '/chgm/' . \Qiniu\entry($bucket, $key) . '/mime/' . base64_encode($mime)); + } + return $data; + } + + public static function buildBatchChangeType($bucket, $key_type_pairs) + { + $data = array(); + foreach ($key_type_pairs as $key => $type) { + array_push($data, '/chtype/' . \Qiniu\entry($bucket, $key) . '/type/' . $type); + } + return $data; + } + + public static function buildBatchRestoreAr($bucket, $key_restore_days_pairs) + { + $data = array(); + foreach ($key_restore_days_pairs as $key => $restore_days) { + array_push($data, '/restoreAr/' . \Qiniu\entry($bucket, $key) . '/freezeAfterDays/' . $restore_days); + } + return $data; + } + + private static function oneKeyBatch($operation, $bucket, $keys) + { + $data = array(); + foreach ($keys as $key) { + array_push($data, $operation . '/' . \Qiniu\entry($bucket, $key)); + } + return $data; + } + + private static function twoKeyBatch($operation, $source_bucket, $key_pairs, $target_bucket, $force) + { + if ($target_bucket === null) { + $target_bucket = $source_bucket; + } + $data = array(); + $forceOp = "false"; + if ($force) { + $forceOp = "true"; + } + foreach ($key_pairs as $from_key => $to_key) { + $from = \Qiniu\entry($source_bucket, $from_key); + $to = \Qiniu\entry($target_bucket, $to_key); + array_push($data, $operation . '/' . $from . '/' . $to . "/force/" . $forceOp); + } + return $data; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Storage/FormUploader.php b/vendor/qiniu/php-sdk/src/Qiniu/Storage/FormUploader.php new file mode 100644 index 0000000..d68654d --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Storage/FormUploader.php @@ -0,0 +1,165 @@ + "", + * "key" => "" + * ] + */ + public static function put( + $upToken, + $key, + $data, + $config, + $params, + $mime, + $fname, + $reqOpt = null + ) { + if ($reqOpt == null) { + $reqOpt = new RequestOptions(); + } + $fields = array('token' => $upToken); + if ($key === null) { + } else { + $fields['key'] = $key; + } + + //enable crc32 check by default + $fields['crc32'] = \Qiniu\crc32_data($data); + + if ($params) { + foreach ($params as $k => $v) { + $fields[$k] = $v; + } + } + + list($accessKey, $bucket, $err) = \Qiniu\explodeUpToken($upToken); + if ($err != null) { + return array(null, $err); + } + + list($upHost, $err) = $config->getUpHostV2($accessKey, $bucket, $reqOpt); + if ($err != null) { + return array(null, $err); + } + + + $response = Client::multipartPost( + $upHost, + $fields, + 'file', + $fname, + $data, + $mime, + array(), + $reqOpt + ); + if (!$response->ok()) { + return array(null, new Error($upHost, $response)); + } + return array($response->json(), null); + } + + /** + * 上传文件到七牛,内部使用 + * + * @param string $upToken 上传凭证 + * @param string $key 上传文件名 + * @param string $filePath 上传文件的路径 + * @param Config $config 上传配置 + * @param string $params 自定义变量,规格参考 + * https://developer.qiniu.com/kodo/manual/1235/vars#xvar + * @param string $mime 上传数据的mimeType + * + * @return array 包含已上传文件的信息,类似: + * [ + * "hash" => "", + * "key" => "" + * ] + */ + public static function putFile( + $upToken, + $key, + $filePath, + $config, + $params, + $mime, + $reqOpt = null + ) { + if ($reqOpt == null) { + $reqOpt = new RequestOptions(); + } + + $fields = array('token' => $upToken, 'file' => self::createFile($filePath, $mime)); + if ($key !== null) { + $fields['key'] = $key; + } + + $fields['crc32'] = \Qiniu\crc32_file($filePath); + + if ($params) { + foreach ($params as $k => $v) { + $fields[$k] = $v; + } + } + $fields['key'] = $key; + $headers = array('Content-Type' => 'multipart/form-data'); + + list($accessKey, $bucket, $err) = \Qiniu\explodeUpToken($upToken); + if ($err != null) { + return array(null, $err); + } + + list($upHost, $err) = $config->getUpHostV2($accessKey, $bucket, $reqOpt); + if ($err != null) { + return array(null, $err); + } + + $response = Client::post($upHost, $fields, $headers, $reqOpt); + if (!$response->ok()) { + return array(null, new Error($upHost, $response)); + } + return array($response->json(), null); + } + + private static function createFile($filename, $mime) + { + // PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax + // See: https://wiki.php.net/rfc/curl-file-upload + if (function_exists('curl_file_create')) { + return curl_file_create($filename, $mime); + } + + // Use the old style if using an older version of PHP + $value = "@{$filename}"; + if (!empty($mime)) { + $value .= ';type=' . $mime; + } + + return $value; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Storage/ResumeUploader.php b/vendor/qiniu/php-sdk/src/Qiniu/Storage/ResumeUploader.php new file mode 100644 index 0000000..00e88ef --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Storage/ResumeUploader.php @@ -0,0 +1,580 @@ + $params 自定义变量 + * @param string $mime 上传数据的mimeType + * @param Config $config + * @param string $resumeRecordFile 断点续传的已上传的部分信息记录文件 + * @param string $version 分片上传版本 目前支持v1/v2版本 默认v1 + * @param int $partSize 分片上传v2字段 默认大小为4MB 分片大小范围为1 MB - 1 GB + * @param RequestOptions $reqOpt 分片上传v2字段 默认大小为4MB 分片大小范围为1 MB - 1 GB + * @throws \Exception + * + * @link http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar + */ + public function __construct( + $upToken, + $key, + $inputStream, + $size, + $params, + $mime, + $config, + $resumeRecordFile = null, + $version = 'v1', + $partSize = config::BLOCK_SIZE, + $reqOpt = null + ) { + + $this->upToken = $upToken; + $this->key = $key; + $this->inputStream = $inputStream; + $this->size = $size; + $this->params = $params; + $this->mime = $mime; + $this->contexts = array(); + $this->finishedEtags = array("etags" => array(), "uploadId" => "", "expiredAt" => 0, "uploaded" => 0); + $this->config = $config; + $this->resumeRecordFile = $resumeRecordFile ? $resumeRecordFile : null; + $this->partSize = $partSize ? $partSize : config::BLOCK_SIZE; + + if ($reqOpt === null) { + $reqOpt = new RequestOptions(); + } + $this->reqOpt = $reqOpt; + + try { + $this->version = SplitUploadVersion::from($version ? $version : 'v1'); + } catch (\Exception $e) { + throw new \Exception("only support v1/v2 now!", 0, $e); + } + + list($accessKey, $bucket, $err) = \Qiniu\explodeUpToken($upToken); + $this->bucket = $bucket; + if ($err != null) { + return array(null, $err); + } + + list($upHost, $err) = $config->getUpHostV2($accessKey, $bucket, $reqOpt); + if ($err != null) { + throw new \Exception($err->message(), 1); + } + $this->host = $upHost; + } + + /** + * 上传操作 + * @param $fname string 文件名 + * + * @throws \Exception + */ + public function upload($fname) + { + $blkputRets = null; + // get upload record from resumeRecordFile + if ($this->resumeRecordFile != null) { + if (file_exists($this->resumeRecordFile)) { + $stream = fopen($this->resumeRecordFile, 'r'); + if ($stream) { + $streamLen = filesize($this->resumeRecordFile); + if ($streamLen > 0) { + $contents = fread($stream, $streamLen); + fclose($stream); + if ($contents) { + $blkputRets = json_decode($contents, true); + if ($blkputRets === null) { + error_log("resumeFile contents decode error"); + } + } else { + error_log("read resumeFile failed"); + } + } else { + error_log("resumeFile is empty"); + } + } else { + error_log("resumeFile open failed"); + } + } else { + error_log("resumeFile not exists"); + } + } + + if ($this->version == SplitUploadVersion::V1) { + return $this->uploadV1($fname, $blkputRets); + } elseif ($this->version == SplitUploadVersion::V2) { + return $this->uploadV2($fname, $blkputRets); + } else { + throw new \Exception("only support v1/v2 now!"); + } + } + + /** + * @param string $fname 文件名 + * @param null|array $blkputRets + * + * @throws \Exception + */ + private function uploadV1($fname, $blkputRets = null) + { + // 尝试恢复恢复已上传的数据 + $isResumeUpload = $blkputRets !== null; + $this->contexts = array(); + + if ($blkputRets) { + if (isset($blkputRets['contexts']) && isset($blkputRets['uploaded']) && + is_array($blkputRets['contexts']) && is_int($blkputRets['uploaded']) + ) { + $this->contexts = array_map(function ($ctx) { + if (is_array($ctx)) { + return $ctx; + } else { + // 兼容旧版本(旧版本没有存储 expireAt) + return array( + "ctx" => $ctx, + "expiredAt" => 0, + ); + } + }, $blkputRets['contexts']); + } + } + + // 上传分片 + $uploaded = 0; + while ($uploaded < $this->size) { + $blockSize = $this->blockSize($uploaded); + $blockIndex = $uploaded / $this->partSize; + if (!is_int($blockIndex)) { + throw new \Exception("v1 part size changed"); + } + // 如果已上传该分片且没有过期 + if (isset($this->contexts[$blockIndex]) && $this->contexts[$blockIndex]["expiredAt"] >= time()) { + $uploaded += $blockSize; + fseek($this->inputStream, $blockSize, SEEK_CUR); + continue; + } + $data = fread($this->inputStream, $blockSize); + if ($data === false) { + throw new \Exception("file read failed", 1); + } + $crc = \Qiniu\crc32_data($data); + $response = $this->makeBlock($data, $blockSize); + + + $ret = null; + if ($response->ok() && $response->json() != null) { + $ret = $response->json(); + } + if ($response->statusCode < 0) { + list($accessKey, $bucket, $err) = \Qiniu\explodeUpToken($this->upToken); + if ($err != null) { + return array(null, $err); + } + list($upHostBackup, $err) = $this->config->getUpBackupHostV2($accessKey, $bucket, $this->reqOpt); + if ($err != null) { + return array(null, $err); + } + $this->host = $upHostBackup; + } + + if ($response->needRetry() || !isset($ret['crc32']) || $crc != $ret['crc32']) { + $response = $this->makeBlock($data, $blockSize); + $ret = $response->json(); + } + if (!$response->ok() || !isset($ret['crc32']) || $crc != $ret['crc32']) { + return array(null, new Error($this->currentUrl, $response)); + } + + // 如果可以在已上传取到说明是过期分片直接修改已上传信息,否则是新的片添加到已上传分片尾部 + if (isset($this->contexts[$blockIndex])) { + $this->contexts[$blockIndex] = array( + 'ctx' => $ret['ctx'], + 'expiredAt' => $ret['expired_at'], + ); + } else { + array_push($this->contexts, array( + 'ctx' => $ret['ctx'], + 'expiredAt' => $ret['expired_at'], + )); + } + $uploaded += $blockSize; + + // 记录断点 + if ($this->resumeRecordFile !== null) { + $recordData = array( + 'contexts' => $this->contexts, + 'uploaded' => $uploaded + ); + $recordData = json_encode($recordData); + + if ($recordData) { + $isWritten = file_put_contents($this->resumeRecordFile, $recordData); + if ($isWritten === false) { + error_log("write resumeRecordFile failed"); + } + } else { + error_log('resumeRecordData encode failed'); + } + } + } + + // 完成上传 + list($ret, $err) = $this->makeFile($fname); + if ($err !== null) { + $response = $err->getResponse(); + if ($isResumeUpload && $response->statusCode === 701) { + fseek($this->inputStream, 0); + return $this->uploadV1($fname); + } + } + return array($ret, $err); + } + + /** + * @param string $fname 文件名 + * @param null|array $blkputRets + * + * @throws \Exception + */ + private function uploadV2($fname, $blkputRets = null) + { + $uploaded = 0; + $partNumber = 1; + $encodedObjectName = $this->key ? \Qiniu\base64_urlSafeEncode($this->key) : '~'; + $isResumeUpload = $blkputRets !== null; + + // 初始化 upload id + $err = null; + if ($blkputRets) { + if (isset($blkputRets["etags"]) && isset($blkputRets["uploadId"]) && + isset($blkputRets["expiredAt"]) && $blkputRets["expiredAt"] > time() && + $blkputRets["uploaded"] > 0 && is_array($blkputRets["etags"]) && + is_string($blkputRets["uploadId"]) && is_int($blkputRets["expiredAt"]) + ) { + $this->finishedEtags['etags'] = $blkputRets["etags"]; + $this->finishedEtags["uploadId"] = $blkputRets["uploadId"]; + $this->finishedEtags["expiredAt"] = $blkputRets["expiredAt"]; + $this->finishedEtags["uploaded"] = $blkputRets["uploaded"]; + $uploaded = $blkputRets["uploaded"]; + $partNumber = count($this->finishedEtags["etags"]) + 1; + } else { + $err = $this->makeInitReq($encodedObjectName); + } + } else { + $err = $this->makeInitReq($encodedObjectName); + } + if ($err != null) { + return array(null, $err); + } + + // 上传分片 + fseek($this->inputStream, $uploaded); + while ($uploaded < $this->size) { + $blockSize = $this->blockSize($uploaded); + $data = fread($this->inputStream, $blockSize); + if ($data === false) { + throw new \Exception("file read failed", 1); + } + $md5 = md5($data); + $response = $this->uploadPart( + $data, + $partNumber, + $this->finishedEtags["uploadId"], + $encodedObjectName, + $md5 + ); + + $ret = null; + if ($response->ok() && $response->json() != null) { + $ret = $response->json(); + } + if ($response->statusCode < 0) { + list($accessKey, $bucket, $err) = \Qiniu\explodeUpToken($this->upToken); + if ($err != null) { + return array(null, $err); + } + list($upHostBackup, $err) = $this->config->getUpBackupHostV2($accessKey, $bucket, $this->reqOpt); + if ($err != null) { + return array(null, $err); + } + $this->host = $upHostBackup; + } + + if ($response->needRetry() || !isset($ret['md5']) || $md5 != $ret['md5']) { + $response = $this->uploadPart( + $data, + $partNumber, + $this->finishedEtags["uploadId"], + $encodedObjectName, + $md5 + ); + $ret = $response->json(); + } + if ($isResumeUpload && $response->statusCode === 612) { + return $this->uploadV2($fname); + } + if (!$response->ok() || !isset($ret['md5']) || $md5 != $ret['md5']) { + return array(null, new Error($this->currentUrl, $response)); + } + $blockStatus = array('etag' => $ret['etag'], 'partNumber' => $partNumber); + array_push($this->finishedEtags['etags'], $blockStatus); + $partNumber += 1; + + $uploaded += $blockSize; + $this->finishedEtags['uploaded'] = $uploaded; + + if ($this->resumeRecordFile !== null) { + $recordData = json_encode($this->finishedEtags); + if ($recordData) { + $isWritten = file_put_contents($this->resumeRecordFile, $recordData); + if ($isWritten === false) { + error_log("write resumeRecordFile failed"); + } + } else { + error_log('resumeRecordData encode failed'); + } + } + } + + list($ret, $err) = $this->completeParts($fname, $this->finishedEtags['uploadId'], $encodedObjectName); + if ($err !== null) { + $response = $err->getResponse(); + if ($isResumeUpload && $response->statusCode === 612) { + return $this->uploadV2($fname); + } + } + return array($ret, $err); + } + + /** + * 创建块 + */ + private function makeBlock($block, $blockSize) + { + $url = $this->host . '/mkblk/' . $blockSize; + return $this->post($url, $block); + } + + private function fileUrl($fname) + { + $url = $this->host . '/mkfile/' . $this->size; + $url .= '/mimeType/' . \Qiniu\base64_urlSafeEncode($this->mime); + if ($this->key != null) { + $url .= '/key/' . \Qiniu\base64_urlSafeEncode($this->key); + } + $url .= '/fname/' . \Qiniu\base64_urlSafeEncode($fname); + if (!empty($this->params)) { + foreach ($this->params as $key => $value) { + $val = \Qiniu\base64_urlSafeEncode($value); + $url .= "/$key/$val"; + } + } + return $url; + } + + /** + * 创建文件 + * + * @param string $fname 文件名 + * @return array{array | null, Error | null} + */ + private function makeFile($fname) + { + $url = $this->fileUrl($fname); + $body = implode(',', array_map(function ($ctx) { + return $ctx['ctx']; + }, $this->contexts)); + $response = $this->post($url, $body); + if ($response->needRetry()) { + $response = $this->post($url, $body); + } + if ($response->statusCode === 200 || $response->statusCode === 701) { + if ($this->resumeRecordFile !== null) { + @unlink($this->resumeRecordFile); + } + } + if (!$response->ok()) { + return array(null, new Error($this->currentUrl, $response)); + } + return array($response->json(), null); + } + + private function post($url, $data) + { + $this->currentUrl = $url; + $headers = array('Authorization' => 'UpToken ' . $this->upToken); + return Client::post($url, $data, $headers, $this->reqOpt); + } + + private function blockSize($uploaded) + { + if ($this->size < $uploaded + $this->partSize) { + return $this->size - $uploaded; + } + return $this->partSize; + } + + private function makeInitReq($encodedObjectName) + { + list($ret, $err) = $this->initReq($encodedObjectName); + + if ($ret == null) { + return $err; + } + + $this->finishedEtags["uploadId"] = $ret['uploadId']; + $this->finishedEtags["expiredAt"] = $ret['expireAt']; + return $err; + } + + /** + * 初始化上传任务 + */ + private function initReq($encodedObjectName) + { + $url = $this->host . '/buckets/' . $this->bucket . '/objects/' . $encodedObjectName . '/uploads'; + $headers = array( + 'Authorization' => 'UpToken ' . $this->upToken, + 'Content-Type' => 'application/json' + ); + $response = $this->postWithHeaders($url, null, $headers); + $ret = $response->json(); + if ($response->ok() && $ret != null) { + return array($ret, null); + } + + return array(null, new Error($url, $response)); + } + + /** + * 分块上传v2 + */ + private function uploadPart($block, $partNumber, $uploadId, $encodedObjectName, $md5) + { + $headers = array( + 'Authorization' => 'UpToken ' . $this->upToken, + 'Content-Type' => 'application/octet-stream', + 'Content-MD5' => $md5 + ); + $url = $this->host . '/buckets/' . $this->bucket . '/objects/' . $encodedObjectName . + '/uploads/' . $uploadId . '/' . $partNumber; + $response = $this->put($url, $block, $headers); + if ($response->statusCode === 612) { + if ($this->resumeRecordFile !== null) { + @unlink($this->resumeRecordFile); + } + } + return $response; + } + + /** + * 完成分片上传V2 + * + * @param string $fname 文件名 + * @param int $uploadId 由 {@see initReq} 获取 + * @param string $encodedObjectName 经过编码的存储路径 + * @return array{array | null, Error | null} + */ + private function completeParts($fname, $uploadId, $encodedObjectName) + { + $headers = array( + 'Authorization' => 'UpToken ' . $this->upToken, + 'Content-Type' => 'application/json' + ); + $etags = $this->finishedEtags['etags']; + $sortedEtags = \Qiniu\arraySort($etags, 'partNumber'); + $metadata = array(); + $customVars = array(); + if ($this->params) { + foreach ($this->params as $k => $v) { + if (strpos($k, 'x:') === 0) { + $customVars[$k] = $v; + } elseif (strpos($k, 'x-qn-meta-') === 0) { + $metadata[$k] = $v; + } + } + } + if (empty($metadata)) { + $metadata = null; + } + if (empty($customVars)) { + $customVars = null; + } + $body = array( + 'fname' => $fname, + 'mimeType' => $this->mime, + 'metadata' => $metadata, + 'customVars' => $customVars, + 'parts' => $sortedEtags + ); + $jsonBody = json_encode($body); + $url = $this->host . '/buckets/' . $this->bucket . '/objects/' . $encodedObjectName . '/uploads/' . $uploadId; + $response = $this->postWithHeaders($url, $jsonBody, $headers); + if ($response->needRetry()) { + $response = $this->postWithHeaders($url, $jsonBody, $headers); + } + if ($response->statusCode === 200 || $response->statusCode === 612) { + if ($this->resumeRecordFile !== null) { + @unlink($this->resumeRecordFile); + } + } + if (!$response->ok()) { + return array(null, new Error($this->currentUrl, $response)); + } + return array($response->json(), null); + } + + private function put($url, $data, $headers) + { + $this->currentUrl = $url; + return Client::put($url, $data, $headers, $this->reqOpt); + } + + private function postWithHeaders($url, $data, $headers) + { + $this->currentUrl = $url; + return Client::post($url, $data, $headers, $this->reqOpt); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Storage/UploadManager.php b/vendor/qiniu/php-sdk/src/Qiniu/Storage/UploadManager.php new file mode 100644 index 0000000..fcd11fa --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Storage/UploadManager.php @@ -0,0 +1,176 @@ +config = $config; + + if ($reqOpt === null) { + $reqOpt = new RequestOptions(); + } + + $this->reqOpt = $reqOpt; + } + + /** + * 上传二进制流到七牛 + * + * @param string $upToken 上传凭证 + * @param string $key 上传文件名 + * @param string $data 上传二进制流 + * @param array $params 自定义变量,规格参考 + * http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar + * @param string $mime 上传数据的mimeType + * @param string $fname + * @param RequestOptions $reqOpt + * @return array 包含已上传文件的信息,类似: + * [ + * "hash" => "", + * "key" => "" + * ] + */ + public function put( + $upToken, + $key, + $data, + $params = null, + $mime = 'application/octet-stream', + $fname = "default_filename", + $reqOpt = null + ) { + $reqOpt = $reqOpt === null ? $this->reqOpt : $reqOpt; + + $params = self::trimParams($params); + return FormUploader::put( + $upToken, + $key, + $data, + $this->config, + $params, + $mime, + $fname, + $reqOpt + ); + } + + + /** + * 上传文件到七牛 + * + * @param string $upToken 上传凭证 + * @param string $key 上传文件名 + * @param string $filePath 上传文件的路径 + * @param array $params 定义变量,规格参考 + * http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar + * @param boolean $mime 上传数据的mimeType + * @param string $checkCrc 是否校验crc32 + * @param string $resumeRecordFile 断点续传文件路径 默认为null + * @param string $version 分片上传版本 目前支持v1/v2版本 默认v1 + * @param int $partSize 分片上传v2字段 默认大小为4MB 分片大小范围为1 MB - 1 GB + * + * @return array 包含已上传文件的信息,类似: + * [ + * "hash" => "", + * "key" => "" + * ] + * @throws \Exception + */ + public function putFile( + $upToken, + $key, + $filePath, + $params = null, + $mime = 'application/octet-stream', + $checkCrc = false, + $resumeRecordFile = null, + $version = 'v1', + $partSize = config::BLOCK_SIZE, + $reqOpt = null + ) { + $reqOpt = $reqOpt === null ? $this->reqOpt : $reqOpt; + + $file = fopen($filePath, 'rb'); + if ($file === false) { + throw new \Exception("file can not open", 1); + } + $params = self::trimParams($params); + $stat = fstat($file); + $size = $stat['size']; + if ($size <= Config::BLOCK_SIZE) { + $data = fread($file, $size); + fclose($file); + if ($data === false) { + throw new \Exception("file can not read", 1); + } + return FormUploader::put( + $upToken, + $key, + $data, + $this->config, + $params, + $mime, + basename($filePath), + $reqOpt + ); + } + + $up = new ResumeUploader( + $upToken, + $key, + $file, + $size, + $params, + $mime, + $this->config, + $resumeRecordFile, + $version, + $partSize, + $reqOpt + ); + $ret = $up->upload(basename($filePath)); + fclose($file); + return $ret; + } + + public static function trimParams($params) + { + if ($params === null) { + return null; + } + $ret = array(); + foreach ($params as $k => $v) { + $pos1 = strpos($k, 'x:'); + $pos2 = strpos($k, 'x-qn-meta-'); + if (($pos1 === 0 || $pos2 === 0) && !empty($v)) { + $ret[$k] = $v; + } + } + return $ret; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Zone.php b/vendor/qiniu/php-sdk/src/Qiniu/Zone.php new file mode 100644 index 0000000..50d60c6 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Zone.php @@ -0,0 +1,58 @@ + $v) { + $keysValue[$k] = $v[$key]; + } + array_multisort($keysValue, $sort, $array); + return $array; + } + + /** + * Wrapper for JSON decode that implements error detection with helpful + * error messages. + * + * @param string $json JSON data to parse + * @param bool $assoc When true, returned objects will be converted + * into associative arrays. + * @param int $depth User specified recursion depth. + * + * @return mixed + * @throws \InvalidArgumentException if the JSON cannot be parsed. + * @link http://www.php.net/manual/en/function.json-decode.php + */ + function json_decode($json, $assoc = false, $depth = 512) + { + static $jsonErrors = array( + JSON_ERROR_DEPTH => 'JSON_ERROR_DEPTH - Maximum stack depth exceeded', + JSON_ERROR_STATE_MISMATCH => 'JSON_ERROR_STATE_MISMATCH - Underflow or the modes mismatch', + JSON_ERROR_CTRL_CHAR => 'JSON_ERROR_CTRL_CHAR - Unexpected control character found', + JSON_ERROR_SYNTAX => 'JSON_ERROR_SYNTAX - Syntax error, malformed JSON', + JSON_ERROR_UTF8 => 'JSON_ERROR_UTF8 - Malformed UTF-8 characters, possibly incorrectly encoded' + ); + + if (empty($json)) { + return null; + } + $data = \json_decode($json, $assoc, $depth); + + if (JSON_ERROR_NONE !== json_last_error()) { + $last = json_last_error(); + throw new \InvalidArgumentException( + 'Unable to parse JSON data: ' + . (isset($jsonErrors[$last]) + ? $jsonErrors[$last] + : 'Unknown error') + ); + } + + return $data; + } + + /** + * 计算七牛API中的数据格式 + * + * @param string $bucket 待操作的空间名 + * @param string $key 待操作的文件名 + * + * @return string 符合七牛API规格的数据格式 + * @link https://developer.qiniu.com/kodo/api/data-format + */ + function entry($bucket, $key = null) + { + $en = $bucket; + if ($key !== null) { + $en = $bucket . ':' . $key; + } + return base64_urlSafeEncode($en); + } + + function decodeEntry($entry) + { + $en = base64_urlSafeDecode($entry); + $en = explode(':', $en); + if (count($en) == 1) { + return array($en[0], null); + } + return array($en[0], $en[1]); + } + + /** + * array 辅助方法,无值时不set + * + * @param array $array 待操作array + * @param string $key key + * @param string $value value 为null时 不设置 + * + * @return array 原来的array,便于连续操作 + */ + function setWithoutEmpty(&$array, $key, $value) + { + if (!empty($value)) { + $array[$key] = $value; + } + return $array; + } + + /** + * 缩略图链接拼接 + * + * @param string $url 图片链接 + * @param int $mode 缩略模式 + * @param int $width 宽度 + * @param int $height 长度 + * @param string $format 输出类型 + * @param int $quality 图片质量 + * @param int $interlace 是否支持渐进显示 + * @param int $ignoreError 忽略结果 + * @return string + * @link http://developer.qiniu.com/code/v6/api/kodo-api/image/imageview2.html + * @author Sherlock Ren + */ + function thumbnail( + $url, + $mode, + $width, + $height, + $format = null, + $quality = null, + $interlace = null, + $ignoreError = 1 + ) { + + static $imageUrlBuilder = null; + if (is_null($imageUrlBuilder)) { + $imageUrlBuilder = new \Qiniu\Processing\ImageUrlBuilder; + } + + return call_user_func_array(array($imageUrlBuilder, 'thumbnail'), func_get_args()); + } + + /** + * 图片水印 + * + * @param string $url 图片链接 + * @param string $image 水印图片链接 + * @param numeric $dissolve 透明度 + * @param string $gravity 水印位置 + * @param numeric $dx 横轴边距 + * @param numeric $dy 纵轴边距 + * @param numeric $watermarkScale 自适应原图的短边比例 + * @link http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html + * @return string + * @author Sherlock Ren + */ + function waterImg( + $url, + $image, + $dissolve = 100, + $gravity = 'SouthEast', + $dx = null, + $dy = null, + $watermarkScale = null + ) { + + static $imageUrlBuilder = null; + if (is_null($imageUrlBuilder)) { + $imageUrlBuilder = new \Qiniu\Processing\ImageUrlBuilder; + } + + return call_user_func_array(array($imageUrlBuilder, 'waterImg'), func_get_args()); + } + + /** + * 文字水印 + * + * @param string $url 图片链接 + * @param string $text 文字 + * @param string $font 文字字体 + * @param string $fontSize 文字字号 + * @param string $fontColor 文字颜色 + * @param numeric $dissolve 透明度 + * @param string $gravity 水印位置 + * @param numeric $dx 横轴边距 + * @param numeric $dy 纵轴边距 + * @link http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html#text-watermark + * @return string + * @author Sherlock Ren + */ + function waterText( + $url, + $text, + $font = '黑体', + $fontSize = 0, + $fontColor = null, + $dissolve = 100, + $gravity = 'SouthEast', + $dx = null, + $dy = null + ) { + + static $imageUrlBuilder = null; + if (is_null($imageUrlBuilder)) { + $imageUrlBuilder = new \Qiniu\Processing\ImageUrlBuilder; + } + + return call_user_func_array(array($imageUrlBuilder, 'waterText'), func_get_args()); + } + + /** + * 从uptoken解析accessKey和bucket + * + * @param $upToken + * @return array(ak,bucket,err=null) + */ + function explodeUpToken($upToken) + { + $items = explode(':', $upToken); + if (count($items) != 3) { + return array(null, null, "invalid uptoken"); + } + $accessKey = $items[0]; + $putPolicy = json_decode(base64_urlSafeDecode($items[2])); + $scope = $putPolicy->scope; + $scopeItems = explode(':', $scope); + $bucket = $scopeItems[0]; + return array($accessKey, $bucket, null); + } + + // polyfill ucwords for `php version < 5.4.32` or `5.5.0 <= php version < 5.5.16` + if (version_compare(phpversion(), "5.4.32") < 0 || + ( + version_compare(phpversion(), "5.5.0") >= 0 && + version_compare(phpversion(), "5.5.16") < 0 + ) + ) { + function ucwords($str, $delimiters = " \t\r\n\f\v") + { + $delims = preg_split('//u', $delimiters, -1, PREG_SPLIT_NO_EMPTY); + + foreach ($delims as $delim) { + $str = implode($delim, array_map('ucfirst', explode($delim, $str))); + } + + return $str; + } + } else { + function ucwords($str, $delimiters) + { + return \ucwords($str, $delimiters); + } + } + + /** + * 将 parse_url 的结果转换回字符串 + * TODO: add unit test + * + * @param $parsed_url - parse_url 的结果 + * @return string + */ + function unparse_url($parsed_url) + { + + $scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : ''; + + $host = isset($parsed_url['host']) ? $parsed_url['host'] : ''; + + $port = isset($parsed_url['port']) ? ':' . $parsed_url['port'] : ''; + + $user = isset($parsed_url['user']) ? $parsed_url['user'] : ''; + + $pass = isset($parsed_url['pass']) ? ':' . $parsed_url['pass'] : ''; + + $pass = ($user || $pass) ? "$pass@" : ''; + + $path = isset($parsed_url['path']) ? $parsed_url['path'] : ''; + + $query = isset($parsed_url['query']) ? '?' . $parsed_url['query'] : ''; + + $fragment = isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : ''; + + return "$scheme$user$pass$host$port$path$query$fragment"; + } +} diff --git a/vendor/qiniu/php-sdk/test-env.sh b/vendor/qiniu/php-sdk/test-env.sh new file mode 100644 index 0000000..eedf6b5 --- /dev/null +++ b/vendor/qiniu/php-sdk/test-env.sh @@ -0,0 +1,4 @@ +export QINIU_ACCESS_KEY=xxx +export QINIU_SECRET_KEY=xxx +export QINIU_TEST_BUCKET=phpsdk +export QINIU_TEST_DOMAIN=phpsdk.qiniudn.com \ No newline at end of file diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/AuthTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/AuthTest.php new file mode 100644 index 0000000..bd1705f --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/AuthTest.php @@ -0,0 +1,240 @@ +sign('test'); + $this->assertEquals('abcdefghklmnopq:mSNBTR7uS2crJsyFr2Amwv1LaYg=', $token); + } + + public function testSignWithData() + { + global $dummyAuth; + $token = $dummyAuth->signWithData('test'); + $this->assertEquals('abcdefghklmnopq:-jP8eEV9v48MkYiBGs81aDxl60E=:dGVzdA==', $token); + } + + public function testSignRequest() + { + global $dummyAuth; + $token = $dummyAuth->signRequest('http://www.qiniu.com?go=1', 'test', ''); + $this->assertEquals('abcdefghklmnopq:cFyRVoWrE3IugPIMP5YJFTO-O-Y=', $token); + $ctype = 'application/x-www-form-urlencoded'; + $token = $dummyAuth->signRequest('http://www.qiniu.com?go=1', 'test', $ctype); + $this->assertEquals($token, 'abcdefghklmnopq:svWRNcacOE-YMsc70nuIYdaa1e4='); + } + + public function testPrivateDownloadUrl() + { + global $dummyAuth; + $_SERVER['override_qiniu_auth_time'] = true; + $url = $dummyAuth->privateDownloadUrl('http://www.qiniu.com?go=1'); + $expect = 'http://www.qiniu.com?go=1&e=1234571490&token=abcdefghklmnopq:8vzBeLZ9W3E4kbBLFLW0Xe0u7v4='; + $this->assertEquals($expect, $url); + unset($_SERVER['override_qiniu_auth_time']); + } + + public function testUploadToken() + { + global $dummyAuth; + $_SERVER['override_qiniu_auth_time'] = true; + $token = $dummyAuth->uploadToken('1', '2', 3600, array('endUser' => 'y')); + // @codingStandardsIgnoreStart + $exp = 'abcdefghklmnopq:yyeexeUkPOROoTGvwBjJ0F0VLEo=:eyJlbmRVc2VyIjoieSIsInNjb3BlIjoiMToyIiwiZGVhZGxpbmUiOjEyMzQ1NzE0OTB9'; + // @codingStandardsIgnoreEnd + $this->assertEquals($exp, $token); + unset($_SERVER['override_qiniu_auth_time']); + } + + public function testSignQiniuAuthorization() + { + $auth = new Auth("ak", "sk"); + + $testCases = array( + array( + "url" => "", + "method" => "", + "headers" => array( + "X-Qiniu-" => array("a"), + "X-Qiniu" => array("b"), + "Content-Type" => array("application/x-www-form-urlencoded") + ), + "body" => "{\"name\": \"test\"}", + "expectedToken" => "ak:0i1vKClRDWFyNkcTFzwcE7PzX74=" + ), + array( + "url" => "", + "method" => "", + "headers" => array( + "Content-Type" => array("application/json") + ), + "body" => "{\"name\": \"test\"}", + "expectedToken" => "ak:K1DI0goT05yhGizDFE5FiPJxAj4=" + ), + array( + "url" => "", + "method" => "GET", + "headers" => array( + "X-Qiniu-" => array("a"), + "X-Qiniu" => array("b"), + "Content-Type" => array("application/x-www-form-urlencoded"), + ), + "body" => "{\"name\": \"test\"}", + "expectedToken" => "ak:0i1vKClRDWFyNkcTFzwcE7PzX74=" + ), + array( + "url" => "", + "method" => "POST", + "headers" => array( + "Content-Type" => array("application/json"), + "X-Qiniu" => array("b"), + ), + "body" => "{\"name\": \"test\"}", + "expectedToken" => "ak:0ujEjW_vLRZxebsveBgqa3JyQ-w=" + ), + array( + "url" => "http://upload.qiniup.com", + "method" => "", + "headers" => array( + "X-Qiniu-" => array("a"), + "X-Qiniu" => array("b"), + "Content-Type" => array("application/x-www-form-urlencoded"), + ), + "body" => "{\"name\": \"test\"}", + "expectedToken" => "ak:GShw5NitGmd5TLoo38nDkGUofRw=" + ), + array( + "url" => "http://upload.qiniup.com", + "method" => "", + "headers" => array( + "Content-Type" => array("application/json"), + "X-Qiniu-Bbb" => array("BBB", "AAA"), + "X-Qiniu-Aaa" => array("DDD", "CCC"), + "X-Qiniu-" => array("a"), + "X-Qiniu" => array("b"), + ), + "body" => "{\"name\": \"test\"}", + "expectedToken" => "ak:DhNA1UCaBqSHCsQjMOLRfVn63GQ=" + ), + array( + "url" => "http://upload.qiniup.com", + "method" => "", + "headers" => array( + "Content-Type" => array("application/x-www-form-urlencoded"), + "X-Qiniu-Bbb" => array("BBB", "AAA"), + "X-Qiniu-Aaa" => array("DDD", "CCC"), + "X-Qiniu-" => array("a"), + "X-Qiniu" => array("b"), + ), + "body" => "name=test&language=go", + "expectedToken" => "ak:KUAhrYh32P9bv0COD8ugZjDCmII=" + ), + array( + "url" => "http://upload.qiniup.com", + "method" => "", + "headers" => array( + "Content-Type" => array("application/x-www"), + "Content-Type" => array("application/x-www-form-urlencoded"), + "X-Qiniu-Bbb" => array("BBB", "AAA"), + "X-Qiniu-Aaa" => array("DDD", "CCC"), + ), + "body" => "name=test&language=go", + "expectedToken" => "ak:KUAhrYh32P9bv0COD8ugZjDCmII=" + ), + array( + "url" => "http://upload.qiniup.com/mkfile/sdf.jpg", + "method" => "", + "headers" => array( + "Content-Type" => array("application/x-www-form-urlencoded"), + "X-Qiniu-Bbb" => array("BBB", "AAA"), + "X-Qiniu-Aaa" => array("DDD", "CCC"), + "X-Qiniu-" => array("a"), + "X-Qiniu" => array("b"), + ), + "body" => "name=test&language=go", + "expectedToken" => "ak:fkRck5_LeyfwdkyyLk-hyNwGKac=" + ), + array( + "url" => "http://upload.qiniup.com/mkfile/sdf.jpg?s=er3&df", + "method" => "", + "headers" => array( + "Content-Type" => array("application/x-www-form-urlencoded"), + "X-Qiniu-Bbb" => array("BBB", "AAA"), + "X-Qiniu-Aaa" => array("DDD", "CCC"), + "X-Qiniu-" => array("a"), + "X-Qiniu" => array("b"), + ), + "body" => "name=test&language=go", + "expectedToken" => "ak:PUFPWsEUIpk_dzUvvxTTmwhp3p4=" + ) + ); + + foreach ($testCases as $testCase) { + list($sign, $err) = $auth->signQiniuAuthorization( + $testCase["url"], + $testCase["method"], + $testCase["body"], + new Header($testCase["headers"]) + ); + + $this->assertNull($err); + $this->assertEquals($testCase["expectedToken"], $sign); + } + } + + public function testDisableQiniuTimestampSignatureDefault() + { + $auth = new Auth("ak", "sk"); + $authedHeaders = $auth->authorizationV2("https://example.com", "GET"); + $this->assertArrayHasKey("X-Qiniu-Date", $authedHeaders); + } + + public function testDisableQiniuTimestampSignature() + { + $auth = new Auth("ak", "sk", array( + "disableQiniuTimestampSignature" => true + )); + $authedHeaders = $auth->authorizationV2("https://example.com", "GET"); + $this->assertArrayNotHasKey("X-Qiniu-Date", $authedHeaders); + } + public function testDisableQiniuTimestampSignatureEnv() + { + putenv("DISABLE_QINIU_TIMESTAMP_SIGNATURE=true"); + $auth = new Auth("ak", "sk"); + $authedHeaders = $auth->authorizationV2("https://example.com", "GET"); + $this->assertArrayNotHasKey("X-Qiniu-Date", $authedHeaders); + putenv('DISABLE_QINIU_TIMESTAMP_SIGNATURE'); + } + public function testDisableQiniuTimestampSignatureEnvBeIgnored() + { + putenv("DISABLE_QINIU_TIMESTAMP_SIGNATURE=true"); + $auth = new Auth("ak", "sk", array( + "disableQiniuTimestampSignature" => false + )); + $authedHeaders = $auth->authorizationV2("https://example.com", "GET"); + $this->assertArrayHasKey("X-Qiniu-Date", $authedHeaders); + putenv('DISABLE_QINIU_TIMESTAMP_SIGNATURE'); + } + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/Base64Test.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/Base64Test.php new file mode 100644 index 0000000..fed3da0 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/Base64Test.php @@ -0,0 +1,16 @@ +assertEquals($a, \Qiniu\base64_urlSafeDecode($b)); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/BucketTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/BucketTest.php new file mode 100644 index 0000000..0467698 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/BucketTest.php @@ -0,0 +1,733 @@ +batch($ops); + } + + private static function getObjectKey($key) + { + $result = $key . rand(); + + self::$bucketManager->copy( + self::$bucketName, + $key, + self::$bucketName, + $result + ); + + self::$keysToCleanup[] = $result; + + return $result; + } + + public function testBuckets() + { + + list($list, $error) = self::$bucketManager->buckets(); + $this->assertNull($error); + $this->assertTrue(in_array(self::$bucketName, $list)); + + list($list2, $error) = self::$dummyBucketManager->buckets(); + $this->assertEquals(401, $error->code()); + $this->assertNotNull($error->message()); + $this->assertNotNull($error->getResponse()); + $this->assertNull($list2); + } + + public function testListBuckets() + { + list($ret, $error) = self::$bucketManager->listbuckets('z0'); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testCreateBucket() + { + list($ret, $error) = self::$bucketManager->createBucket(self::$bucketToCreate); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testDeleteBucket() + { + list($ret, $error) = self::$bucketManager->deleteBucket(self::$bucketToCreate); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testDomains() + { + list($ret, $error) = self::$bucketManager->domains(self::$bucketName); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testBucketInfo() + { + list($ret, $error) = self::$bucketManager->bucketInfo(self::$bucketName); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testBucketInfos() + { + list($ret, $error) = self::$bucketManager->bucketInfos('z0'); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testList() + { + list($ret, $error) = self::$bucketManager->listFiles(self::$bucketName, null, null, 10); + $this->assertNull($error); + $this->assertNotNull($ret['items'][0]); + $this->assertNotNull($ret['marker']); + } + + public function testListFilesv2() + { + list($ret, $error) = self::$bucketManager->listFilesv2(self::$bucketName, null, null, 10); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testBucketLifecycleRule() + { + // delete + self::$bucketManager->deleteBucketLifecycleRule(self::$bucketName, self::$bucketLifeRuleName); + + // add + list($ret, $error) = self::$bucketManager->bucketLifecycleRule( + self::$bucketName, + self::$bucketLifeRuleName, + self::$bucketLifeRulePrefix, + 80, + 70, + 72, + 74, + 71 + ); + $this->assertNull($error); + $this->assertNotNull($ret); + + // get + list($ret, $error) = self::$bucketManager->getBucketLifecycleRules(self::$bucketName); + $this->assertNull($error); + $this->assertNotNull($ret); + $rule = null; + foreach ($ret as $r) { + if ($r["name"] === self::$bucketLifeRuleName) { + $rule = $r; + break; + } + } + $this->assertNotNull($rule); + $this->assertEquals(self::$bucketLifeRulePrefix, $rule["prefix"]); + $this->assertEquals(80, $rule["delete_after_days"]); + $this->assertEquals(70, $rule["to_line_after_days"]); + $this->assertEquals(71, $rule["to_archive_ir_after_days"]); + $this->assertEquals(72, $rule["to_archive_after_days"]); + $this->assertEquals(74, $rule["to_deep_archive_after_days"]); + + // update + list($ret, $error) = self::$bucketManager->updateBucketLifecycleRule( + self::$bucketName, + self::$bucketLifeRuleName, + 'update-' . self::$bucketLifeRulePrefix, + 90, + 75, + 80, + 85, + 78 + ); + $this->assertNull($error); + $this->assertNotNull($ret); + + // get + list($ret, $error) = self::$bucketManager->getBucketLifecycleRules(self::$bucketName); + $this->assertNull($error); + $this->assertNotNull($ret); + $rule = null; + foreach ($ret as $r) { + if ($r["name"] === self::$bucketLifeRuleName) { + $rule = $r; + break; + } + } + $this->assertNotNull($rule); + $this->assertEquals('update-' . self::$bucketLifeRulePrefix, $rule["prefix"]); + $this->assertEquals(90, $rule["delete_after_days"]); + $this->assertEquals(75, $rule["to_line_after_days"]); + $this->assertEquals(78, $rule["to_archive_ir_after_days"]); + $this->assertEquals(80, $rule["to_archive_after_days"]); + $this->assertEquals(85, $rule["to_deep_archive_after_days"]); + + // delete + list($ret, $error) = self::$bucketManager->deleteBucketLifecycleRule( + self::$bucketName, + self::$bucketLifeRuleName + ); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testPutBucketEvent() + { + list($ret, $error) = self::$bucketManager->putBucketEvent( + self::$bucketName, + self::$bucketEventName, + self::$bucketEventPrefix, + 'img', + array('copy'), + self::$customCallbackURL + ); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testUpdateBucketEvent() + { + list($ret, $error) = self::$bucketManager->updateBucketEvent( + self::$bucketName, + self::$bucketEventName, + self::$bucketEventPrefix, + 'video', + array('copy'), + self::$customCallbackURL + ); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testGetBucketEvents() + { + list($ret, $error) = self::$bucketManager->getBucketEvents(self::$bucketName); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testDeleteBucketEvent() + { + list($ret, $error) = self::$bucketManager->deleteBucketEvent(self::$bucketName, self::$bucketEventName); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testStat() + { + list($stat, $error) = self::$bucketManager->stat(self::$bucketName, self::$key); + $this->assertNull($error); + $this->assertNotNull($stat); + $this->assertNotNull($stat['hash']); + + list($stat, $error) = self::$bucketManager->stat(self::$bucketName, 'nofile'); + $this->assertEquals(612, $error->code()); + $this->assertNotNull($error->message()); + $this->assertNull($stat); + + list($stat, $error) = self::$bucketManager->stat('nobucket', 'nofile'); + $this->assertEquals(631, $error->code()); + $this->assertNotNull($error->message()); + $this->assertNull($stat); + } + + public function testDelete() + { + $fileToDel = self::getObjectKey(self::$key); + list(, $error) = self::$bucketManager->delete(self::$bucketName, $fileToDel); + $this->assertNull($error); + } + + + public function testRename() + { + $fileToRename = self::getObjectKey(self::$key); + $fileRenamed = $fileToRename . 'new'; + list(, $error) = self::$bucketManager->rename(self::$bucketName, $fileToRename, $fileRenamed); + $this->assertNull($error); + self::$keysToCleanup[] = $fileRenamed; + } + + + public function testCopy() + { + $fileToCopy = self::getObjectKey(self::$key2); + $fileCopied = $fileToCopy . 'copied'; + + //test force copy + list(, $error) = self::$bucketManager->copy( + self::$bucketName, + $fileToCopy, + self::$bucketName, + $fileCopied, + true + ); + $this->assertNull($error); + + list($fileToCopyStat,) = self::$bucketManager->stat(self::$bucketName, $fileToCopy); + list($fileCopiedStat,) = self::$bucketManager->stat(self::$bucketName, $fileCopied); + + $this->assertEquals($fileToCopyStat['hash'], $fileCopiedStat['hash']); + + self::$keysToCleanup[] = $fileCopied; + } + + + public function testChangeMime() + { + $fileToChange = self::getObjectKey('php-sdk.html'); + list(, $error) = self::$bucketManager->changeMime( + self::$bucketName, + $fileToChange, + 'text/plain' + ); + $this->assertNull($error); + + list($ret, $error) = self::$bucketManager->stat( + self::$bucketName, + $fileToChange + ); + $this->assertNull($error); + $this->assertEquals('text/plain', $ret['mimeType']); + } + + public function testPrefetch() + { + list($ret, $error) = self::$bucketManager->prefetch( + self::$bucketName, + 'php-sdk.html' + ); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testPrefetchFailed() + { + list($ret, $error) = self::$bucketManager->prefetch( + 'fakebucket', + 'php-sdk.html' + ); + $this->assertNotNull($error); + $this->assertNull($ret); + } + + public function testFetch() + { + list($ret, $error) = self::$bucketManager->fetch( + 'http://developer.qiniu.com/docs/v6/sdk/php-sdk.html', + self::$bucketName, + 'fetch.html' + ); + $this->assertNull($error); + $this->assertArrayHasKey('hash', $ret); + + list($ret, $error) = self::$bucketManager->fetch( + 'http://developer.qiniu.com/docs/v6/sdk/php-sdk.html', + self::$bucketName, + '' + ); + $this->assertNull($error); + $this->assertArrayHasKey('key', $ret); + + list($ret, $error) = self::$bucketManager->fetch( + 'http://developer.qiniu.com/docs/v6/sdk/php-sdk.html', + self::$bucketName + ); + $this->assertNull($error); + $this->assertArrayHasKey('key', $ret); + } + + public function testFetchFailed() + { + list($ret, $error) = self::$bucketManager->fetch( + 'http://developer.qiniu.com/docs/v6/sdk/php-sdk.html', + 'fakebucket' + ); + $this->assertNotNull($error); + $this->assertNull($ret); + } + + public function testAsynchFetch() + { + list($ret, $error) = self::$bucketManager->asynchFetch( + 'http://devtools.qiniu.com/qiniu.png', + self::$bucketName, + null, + 'qiniu.png' + ); + $this->assertNull($error); + $this->assertArrayHasKey('id', $ret); + + list($ret, $error) = self::$bucketManager->asynchFetch( + 'http://devtools.qiniu.com/qiniu.png', + self::$bucketName, + null, + '' + ); + $this->assertNull($error); + $this->assertArrayHasKey('id', $ret); + + list($ret, $error) = self::$bucketManager->asynchFetch( + 'http://devtools.qiniu.com/qiniu.png', + self::$bucketName + ); + $this->assertNull($error); + $this->assertArrayHasKey('id', $ret); + } + + public function testAsynchFetchFailed() + { + list($ret, $error) = self::$bucketManager->asynchFetch( + 'http://devtools.qiniu.com/qiniu.png', + 'fakebucket' + ); + $this->assertNotNull($error); + $this->assertNull($ret); + } + + + public function testBatchCopy() + { + $key = 'copyto' . rand(); + $ops = BucketManager::buildBatchCopy( + self::$bucketName, + array(self::$key => $key), + self::$bucketName, + true + ); + list($ret, $error) = self::$bucketManager->batch($ops); + $this->assertNull($error); + $this->assertEquals(200, $ret[0]['code']); + + self::$keysToCleanup[] = $key; + } + + public function testBatchMove() + { + $fileToMove = self::getObjectKey(self::$key); + $fileMoved = $fileToMove . 'to'; + $ops = BucketManager::buildBatchMove( + self::$bucketName, + array($fileToMove => $fileMoved), + self::$bucketName, + true + ); + list($ret, $error) = self::$bucketManager->batch($ops); + $this->assertNull($error); + $this->assertEquals(200, $ret[0]['code']); + self::$keysToCleanup[] = $fileMoved; + } + + public function testBatchRename() + { + $fileToRename = self::getObjectKey(self::$key); + $fileRenamed = $fileToRename . 'to'; + + $ops = BucketManager::buildBatchRename( + self::$bucketName, + array($fileToRename => $fileRenamed), + true + ); + list($ret, $error) = self::$bucketManager->batch($ops); + $this->assertNull($error); + $this->assertEquals(200, $ret[0]['code']); + + self::$keysToCleanup[] = $fileRenamed; + } + + public function testBatchStat() + { + $ops = BucketManager::buildBatchStat(self::$bucketName, array('php-sdk.html')); + list($ret, $error) = self::$bucketManager->batch($ops); + $this->assertNull($error); + $this->assertEquals(200, $ret[0]['code']); + } + + public function testBatchChangeTypeAndBatchRestoreAr() + { + $key = self::getObjectKey(self::$key); + + $ops = BucketManager::buildBatchChangeType(self::$bucketName, array($key => 2)); // 2 Archive + list($ret, $error) = self::$bucketManager->batch($ops); + $this->assertNull($error); + $this->assertEquals(200, $ret[0]['code']); + + $ops = BucketManager::buildBatchRestoreAr(self::$bucketName, array($key => 1)); // 1 day + list($ret, $error) = self::$bucketManager->batch($ops); + $this->assertNull($error); + $this->assertEquals(200, $ret[0]['code']); + } + + public function testDeleteAfterDays() + { + $key = "noexist" . rand(); + list($ret, $error) = self::$bucketManager->deleteAfterDays(self::$bucketName, $key, 1); + $this->assertNotNull($error); + $this->assertNull($ret); + + $key = self::getObjectKey(self::$key); + list(, $error) = self::$bucketManager->deleteAfterDays(self::$bucketName, $key, 1); + $this->assertNull($error); + + list($ret, $error) = self::$bucketManager->stat(self::$bucketName, $key); + $this->assertNull($error); + $this->assertGreaterThan(23 * 3600, $ret['expiration'] - time()); + $this->assertLessThan(48 * 3600, $ret['expiration'] - time()); + } + + public function testSetObjectLifecycle() + { + $key = self::getObjectKey(self::$key); + + list(, $err) = self::$bucketManager->setObjectLifecycle( + self::$bucketName, + $key, + 10, + 20, + 30, + 40, + 15 + ); + $this->assertNull($err); + + list($ret, $error) = self::$bucketManager->stat(self::$bucketName, $key); + $this->assertNull($error); + $this->assertNotNull($ret['transitionToIA']); + $this->assertNotNull($ret['transitionToArchiveIR']); + $this->assertNotNull($ret['transitionToARCHIVE']); + $this->assertNotNull($ret['transitionToDeepArchive']); + $this->assertNotNull($ret['expiration']); + } + + public function testSetObjectLifecycleWithCond() + { + $key = self::getObjectKey(self::$key); + + list($ret, $err) = self::$bucketManager->stat(self::$bucketName, $key); + $this->assertNull($err); + $key_hash = $ret['hash']; + $key_fsize = $ret['fsize']; + + list(, $err) = self::$bucketManager->setObjectLifecycleWithCond( + self::$bucketName, + $key, + array( + 'hash' => $key_hash, + 'fsize' => $key_fsize + ), + 10, + 20, + 30, + 40, + 15 + ); + $this->assertNull($err); + + list($ret, $error) = self::$bucketManager->stat(self::$bucketName, $key); + $this->assertNull($error); + $this->assertNotNull($ret['transitionToIA']); + $this->assertNotNull($ret['transitionToArchiveIR']); + $this->assertNotNull($ret['transitionToARCHIVE']); + $this->assertNotNull($ret['transitionToDeepArchive']); + $this->assertNotNull($ret['expiration']); + } + + public function testBatchSetObjectLifecycle() + { + $key = self::getObjectKey(self::$key); + + $ops = BucketManager::buildBatchSetObjectLifecycle( + self::$bucketName, + array($key), + 10, + 20, + 30, + 40, + 15 + ); + list($ret, $err) = self::$bucketManager->batch($ops); + $this->assertNull($err); + $this->assertEquals(200, $ret[0]['code']); + } + + public function testGetCorsRules() + { + list(, $err) = self::$bucketManager->getCorsRules(self::$bucketName); + $this->assertNull($err); + } + + public function testPutBucketAccessStyleMode() + { + list(, $err) = self::$bucketManager->putBucketAccessStyleMode(self::$bucketName, 0); + $this->assertNull($err); + } + + public function testPutBucketAccessMode() + { + list(, $err) = self::$bucketManager->putBucketAccessMode(self::$bucketName, 0); + $this->assertNull($err); + } + + public function testPutReferAntiLeech() + { + list(, $err) = self::$bucketManager->putReferAntiLeech(self::$bucketName, 0, "1", "*"); + $this->assertNull($err); + } + + public function testPutBucketMaxAge() + { + list(, $err) = self::$bucketManager->putBucketMaxAge(self::$bucketName, 31536000); + $this->assertNull($err); + } + + public function testPutBucketQuota() + { + list(, $err) = self::$bucketManager->putBucketQuota(self::$bucketName, -1, -1); + $this->assertNull($err); + } + + public function testGetBucketQuota() + { + list(, $err) = self::$bucketManager->getBucketQuota(self::$bucketName); + $this->assertNull($err); + } + + public function testChangeType() + { + $fileToChange = self::getObjectKey(self::$key); + + list(, $err) = self::$bucketManager->changeType(self::$bucketName, $fileToChange, 0); + $this->assertNull($err); + + list(, $err) = self::$bucketManager->changeType(self::$bucketName, $fileToChange, 1); + $this->assertNull($err); + } + + public function testArchiveRestoreAr() + { + $key = self::getObjectKey(self::$key); + + self::$bucketManager->changeType(self::$bucketName, $key, 2); + + list(, $err) = self::$bucketManager->restoreAr(self::$bucketName, $key, 2); + $this->assertNull($err); + + list($ret, $err) = self::$bucketManager->stat(self::$bucketName, $key); + $this->assertNull($err); + + $this->assertEquals(2, $ret["type"]); + + // restoreStatus + // null means frozen; + // 1 means be unfreezing; + // 2 means be unfrozen; + $this->assertNotNull($ret["restoreStatus"]); + $this->assertContains($ret["restoreStatus"], array(1, 2)); + } + + public function testDeepArchiveRestoreAr() + { + $key = self::getObjectKey(self::$key); + + self::$bucketManager->changeType(self::$bucketName, $key, 3); + + list(, $err) = self::$bucketManager->restoreAr(self::$bucketName, $key, 1); + $this->assertNull($err); + list($ret, $err) = self::$bucketManager->stat(self::$bucketName, $key); + $this->assertNull($err); + + $this->assertEquals(3, $ret["type"]); + + // restoreStatus + // null means frozen; + // 1 means be unfreezing; + // 2 means be unfrozen; + $this->assertNotNull($ret["restoreStatus"]); + $this->assertContains($ret["restoreStatus"], array(1, 2)); + } + + public function testChangeStatus() + { + $key = self::getObjectKey(self::$key); + + list(, $err) = self::$bucketManager->changeStatus(self::$bucketName, $key, 1); + $this->assertNull($err); + list($ret, $err) = self::$bucketManager->stat(self::$bucketName, $key); + $this->assertNull($err); + $this->assertEquals(1, $ret['status']); + + list(, $err) = self::$bucketManager->changeStatus(self::$bucketName, $key, 0); + $this->assertNull($err); + list($ret, $err) = self::$bucketManager->stat(self::$bucketName, $key); + $this->assertNull($err); + $this->assertArrayNotHasKey('status', $ret); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/CdnManagerTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/CdnManagerTest.php new file mode 100644 index 0000000..baa9486 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/CdnManagerTest.php @@ -0,0 +1,151 @@ +cdnManager = new CdnManager($testAuth); + + global $timestampAntiLeechEncryptKey; + $this->encryptKey = $timestampAntiLeechEncryptKey; + + global $testStartDate; + $this->testStartDate = $testStartDate; + + global $testEndDate; + $this->testEndDate = $testEndDate; + + global $testGranularity; + $this->testGranularity = $testGranularity; + + global $testLogDate; + $this->testLogDate = $testLogDate; + + global $customDomain; + $this->refreshUrl = $customDomain . '/sdktest.png'; + $this->refreshDirs = $customDomain; + $this->customDomain = $customDomain; + + global $customDomain2; + $this->customDomain2 = $customDomain2; + } + + public function testRefreshUrls() + { + list($ret, $err) = $this->cdnManager->refreshUrls(array($this->refreshUrl)); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testRefreshDirs() + { + list($ret, $err) = $this->cdnManager->refreshDirs(array($this->refreshDirs)); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testRefreshUrlsAndDirs() + { + list($ret, $err) = $this->cdnManager->refreshUrlsAndDirs(array($this->refreshUrl), array($this->refreshDirs)); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testGetCdnRefreshList() + { + list($ret, $err) = $this->cdnManager->getCdnRefreshList(null, null, null, 'success'); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testPrefetchUrls() + { + list($ret, $err) = $this->cdnManager->prefetchUrls(array($this->refreshUrl)); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testGetCdnPrefetchList() + { + list($ret, $err) = $this->cdnManager->getCdnPrefetchList(null, null, 'success'); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testGetBandwidthData() + { + list($ret, $err) = $this->cdnManager->getBandwidthData( + array($this->customDomain2), + $this->testStartDate, + $this->testEndDate, + $this->testGranularity + ); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testGetFluxData() + { + list($ret, $err) = $this->cdnManager->getFluxData( + array($this->customDomain2), + $this->testStartDate, + $this->testEndDate, + $this->testGranularity + ); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testGetCdnLogList() + { + $domain = getenv('QINIU_TEST_DOMAIN'); + list($ret, $err) = $this->cdnManager->getCdnLogList(array($domain), $this->testLogDate); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testCreateTimestampAntiLeechUrl() + { + $signUrl = $this->cdnManager->createTimestampAntiLeechUrl($this->refreshUrl, $this->encryptKey, 3600); + $response = Client::get($signUrl); + $this->assertNull($response->error); + $this->assertEquals($response->statusCode, 200); + + $signUrl = $this->cdnManager->createTimestampAntiLeechUrl( + $this->refreshUrl . '?qiniu', + $this->encryptKey, + 3600 + ); + $response = Client::get($signUrl); + $this->assertNull($response->error); + $this->assertEquals($response->statusCode, 200); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ConfigTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ConfigTest.php new file mode 100644 index 0000000..9910c9b --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ConfigTest.php @@ -0,0 +1,118 @@ +accessKey = $accessKey; + global $bucketName; + $this->bucketName = $bucketName; + } + + public function testGetApiHost() + { + $conf = new Config(); + $hasException = false; + $apiHost = ''; + try { + $apiHost = $conf->getApiHost($this->accessKey, $this->bucketName); + } catch (\Exception $e) { + $hasException = true; + } + $this->assertFalse($hasException); + } + + public function testGetApiHostErrored() + { + $conf = new Config(); + $hasException = false; + try { + $conf->getApiHost($this->accessKey, "fakebucket"); + } catch (\Exception $e) { + $hasException = true; + } + $this->assertTrue($hasException); + } + + public function testGetApiHostV2() + { + $conf = new Config(); + list($apiHost, $err) = $conf->getApiHostV2($this->accessKey, $this->bucketName); + $this->assertNull($err); + } + + public function testGetApiHostV2Errored() + { + $conf = new Config(); + list($apiHost, $err) = $conf->getApiHostV2($this->accessKey, "fakebucket"); + $this->assertNotNull($err->code()); + $this->assertEquals(631, $err->code()); + $this->assertNull($apiHost); + } + + public function testSetUcHost() + { + $conf = new Config(); + $this->assertEquals("http://uc.qbox.me", $conf->getUcHost()); + $conf->setUcHost("uc.example.com"); + $this->assertEquals("http://uc.example.com", $conf->getUcHost()); + + $conf = new Config(); + $conf->useHTTPS = true; + $this->assertEquals("https://uc.qbox.me", $conf->getUcHost()); + $conf->setUcHost("uc.example.com"); + $this->assertEquals("https://uc.example.com", $conf->getUcHost()); + } + + public function testGetRegionWithCustomDomain() + { + $conf = new Config(); + $conf->setQueryRegionHost( + "uc.qbox.me" + ); + list(, $err) = $conf->getRsHostV2($this->accessKey, $this->bucketName); + $this->assertNull($err); + } + + public function testGetRegionWithBackupDomains() + { + $conf = new Config(); + $conf->setQueryRegionHost( + "fake-uc.phpsdk.qiniu.com", + array( + "unavailable-uc.phpsdk.qiniu.com", + "uc.qbox.me" // real uc + ) + ); + list(, $err) = $conf->getRsHostV2($this->accessKey, $this->bucketName); + $this->assertNull($err); + } + + public function testGetRegionWithUcAndBackupDomains() + { + $conf = new Config(); + $conf->setUcHost("fake-uc.phpsdk.qiniu.com"); + $conf->setBackupQueryRegionHosts( + array( + "unavailable-uc.phpsdk.qiniu.com", + "uc.qbox.me" // real uc + ) + ); + list(, $err) = $conf->getRsHostV2($this->accessKey, $this->bucketName); + $this->assertNull($err); + } + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/Crc32Test.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/Crc32Test.php new file mode 100644 index 0000000..63e24fd --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/Crc32Test.php @@ -0,0 +1,23 @@ +assertEquals('1352841281', $b); + } + + public function testFile() + { + $b = \Qiniu\crc32_file(__file__); + $c = \Qiniu\crc32_file(__file__); + $this->assertEquals($c, $b); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/DownloadTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/DownloadTest.php new file mode 100644 index 0000000..9b4b034 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/DownloadTest.php @@ -0,0 +1,27 @@ +privateDownloadUrl($base_url); + $response = Client::get($private_url); + $this->assertEquals(200, $response->statusCode); + } + + public function testFop() + { + global $testAuth; + $base_url = 'http://sdk.peterpy.cn/gogopher.jpg?exif'; + $private_url = $testAuth->privateDownloadUrl($base_url); + $response = Client::get($private_url); + $this->assertEquals(200, $response->statusCode); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/EntryTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/EntryTest.php new file mode 100644 index 0000000..73bfac4 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/EntryTest.php @@ -0,0 +1,88 @@ +assertEquals('cWluaXVwaG90b3M6Z29nb3BoZXIuanBn', $encodeEntryURI); + } + + public function testKeyEmpty() + { + $bucket = 'qiniuphotos'; + $key = ''; + $encodeEntryURI = Qiniu\entry($bucket, $key); + $this->assertEquals('cWluaXVwaG90b3M6', $encodeEntryURI); + } + + public function testKeyNull() + { + $bucket = 'qiniuphotos'; + $key = null; + $encodeEntryURI = Qiniu\entry($bucket, $key); + $this->assertEquals('cWluaXVwaG90b3M=', $encodeEntryURI); + } + + public function testKeyNeedReplacePlusSymbol() + { + $bucket = 'qiniuphotos'; + $key = '012ts>a'; + $encodeEntryURI = Qiniu\entry($bucket, $key); + $this->assertEquals('cWluaXVwaG90b3M6MDEydHM-YQ==', $encodeEntryURI); + } + + public function testKeyNeedReplaceSlashSymbol() + { + $bucket = 'qiniuphotos'; + $key = '012ts?a'; + $encodeEntryURI = Qiniu\entry($bucket, $key); + $this->assertEquals('cWluaXVwaG90b3M6MDEydHM_YQ==', $encodeEntryURI); + } + public function testDecodeEntry() + { + $entry = 'cWluaXVwaG90b3M6Z29nb3BoZXIuanBn'; + list($bucket, $key) = Qiniu\decodeEntry($entry); + $this->assertEquals('qiniuphotos', $bucket); + $this->assertEquals('gogopher.jpg', $key); + } + + public function testDecodeEntryWithEmptyKey() + { + $entry = 'cWluaXVwaG90b3M6'; + list($bucket, $key) = Qiniu\decodeEntry($entry); + $this->assertEquals('qiniuphotos', $bucket); + $this->assertEquals('', $key); + } + + public function testDecodeEntryWithNullKey() + { + $entry = 'cWluaXVwaG90b3M='; + list($bucket, $key) = Qiniu\decodeEntry($entry); + $this->assertEquals('qiniuphotos', $bucket); + $this->assertNull($key); + } + + public function testDecodeEntryWithPlusSymbol() + { + $entry = 'cWluaXVwaG90b3M6MDEydHM-YQ=='; + list($bucket, $key) = Qiniu\decodeEntry($entry); + $this->assertEquals('qiniuphotos', $bucket); + $this->assertEquals('012ts>a', $key); + } + + public function testDecodeEntryWithSlashSymbol() + { + $entry = 'cWluaXVwaG90b3M6MDEydHM_YQ=='; + list($bucket, $key) = Qiniu\decodeEntry($entry); + $this->assertEquals('qiniuphotos', $bucket); + $this->assertEquals('012ts?a', $key); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/EtagTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/EtagTest.php new file mode 100644 index 0000000..4e09a78 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/EtagTest.php @@ -0,0 +1,54 @@ +assertEquals('Fto5o-5ea0sNMlW_75VgGJCv2AcJ', $r); + $this->assertNull($error); + } + + public function testLess4M() + { + $file = qiniuTempFile(3 * 1024 * 1024, false); + list($r, $error) = Etag::sum($file); + unlink($file); + $this->assertEquals('Fs5BpnAjRykYTg6o5E09cjuXrDkG', $r); + $this->assertNull($error); + } + + public function test4M() + { + $file = qiniuTempFile(4 * 1024 * 1024, false); + list($r, $error) = Etag::sum($file); + unlink($file); + $this->assertEquals('FiuKULnybewpEnrfTmxjsxc-3dWp', $r); + $this->assertNull($error); + } + + public function testMore4M() + { + $file = qiniuTempFile(5 * 1024 * 1024, false); + list($r, $error) = Etag::sum($file); + unlink($file); + $this->assertEquals('lhvyfIWMYFTq4s4alzlhXoAkqfVL', $r); + $this->assertNull($error); + } + + public function test8M() + { + $file = qiniuTempFile(8 * 1024 * 1024, false); + list($r, $error) = Etag::sum($file); + unlink($file); + $this->assertEquals('lmRm9ZfGZ86bnMys4wRTWtJj9ClG', $r); + $this->assertNull($error); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/FopTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/FopTest.php new file mode 100644 index 0000000..42b7997 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/FopTest.php @@ -0,0 +1,39 @@ +execute('gogopher.jpg', 'exif'); + $this->assertNull($error); + $this->assertNotNull($exif); + } + + public function testExifPrivate() + { + global $testAuth; + $fop = new Operation('private-res.qiniudn.com', $testAuth); + list($exif, $error) = $fop->execute('noexif.jpg', 'exif'); + $this->assertNotNull($error); + $this->assertNull($exif); + } + + public function testbuildUrl() + { + $fops = 'imageView2/2/h/200'; + $fop = new Operation('testres.qiniudn.com'); + $url = $fop->buildUrl('gogopher.jpg', $fops); + $this->assertEquals($url, 'http://testres.qiniudn.com/gogopher.jpg?imageView2/2/h/200'); + + $fops = array('imageView2/2/h/200', 'imageInfo'); + $url = $fop->buildUrl('gogopher.jpg', $fops); + $this->assertEquals($url, 'http://testres.qiniudn.com/gogopher.jpg?imageView2/2/h/200|imageInfo'); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/FormUpTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/FormUpTest.php new file mode 100644 index 0000000..f75794e --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/FormUpTest.php @@ -0,0 +1,205 @@ +batch($ops); + } + + private static function getObjectKey($key) + { + $result = $key . rand(); + self::$keysToCleanup[] = $result; + return $result; + } + + public function testData() + { + $key = self::getObjectKey('formput'); + $token = self::$auth->uploadToken(self::$bucketName); + list($ret, $error) = FormUploader::put($token, $key, 'hello world', self::$cfg, null, 'text/plain', null); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + } + + public function testDataWithProxy() + { + $key = self::getObjectKey('formput'); + $token = self::$auth->uploadToken(self::$bucketName); + list($ret, $error) = FormUploader::put( + $token, + $key, + 'hello world', + self::$cfg, + null, + 'text/plain', + null, + $this->makeReqOpt() + ); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + } + + public function testData2() + { + $key = self::getObjectKey('formput'); + $upManager = new UploadManager(); + $token = self::$auth->uploadToken(self::$bucketName); + list($ret, $error) = $upManager->put($token, $key, 'hello world', null, 'text/plain', null); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + } + + public function testData2WithProxy() + { + $key = self::getObjectKey('formput'); + $upManager = new UploadManager(); + $token = self::$auth->uploadToken(self::$bucketName); + list($ret, $error) = $upManager->put( + $token, + $key, + 'hello world', + null, + 'text/plain', + null, + $this->makeReqOpt() + ); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + } + + public function testDataFailed() + { + $key = self::getObjectKey('formput'); + $token = self::$auth->uploadToken('fakebucket'); + list($ret, $error) = FormUploader::put( + $token, + $key, + 'hello world', + self::$cfg, + null, + 'text/plain', + null + ); + $this->assertNull($ret); + $this->assertNotNull($error); + } + + public function testFile() + { + $key = self::getObjectKey('formPutFile'); + $token = self::$auth->uploadToken(self::$bucketName, $key); + list($ret, $error) = FormUploader::putFile( + $token, + $key, + __file__, + self::$cfg, + null, + 'text/plain', + null + ); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + } + + public function testFileWithProxy() + { + $key = self::getObjectKey('formPutFile'); + $token = self::$auth->uploadToken(self::$bucketName, $key); + list($ret, $error) = FormUploader::putFile( + $token, + $key, + __file__, + self::$cfg, + null, + 'text/plain', + $this->makeReqOpt() + ); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + } + + public function testFile2() + { + $key = self::getObjectKey('formPutFile'); + $token = self::$auth->uploadToken(self::$bucketName, $key); + $upManager = new UploadManager(); + list($ret, $error) = $upManager->putFile($token, $key, __file__, null, 'text/plain', null); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + } + + public function testFile2WithProxy() + { + $key = self::getObjectKey('formPutFile'); + $token = self::$auth->uploadToken(self::$bucketName, $key); + $upManager = new UploadManager(); + list($ret, $error) = $upManager->putFile( + $token, + $key, + __file__, + null, + 'text/plain', + false, + null, + 'v1', + Config::BLOCK_SIZE, + $this->makeReqOpt() + ); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + } + + public function testFileFailed() + { + $key = self::getObjectKey('fakekey'); + $token = self::$auth->uploadToken('fakebucket', $key); + list($ret, $error) = FormUploader::putFile($token, $key, __file__, self::$cfg, null, 'text/plain', null); + $this->assertNull($ret); + $this->assertNotNull($error); + } + + private function makeReqOpt() + { + $reqOpt = new RequestOptions(); + $reqOpt->proxy = 'socks5://127.0.0.1:8080'; + $reqOpt->proxy_user_password = 'user:pass'; + return $reqOpt; + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/HeaderTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/HeaderTest.php new file mode 100644 index 0000000..28af5f3 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/HeaderTest.php @@ -0,0 +1,184 @@ + array('200'), + ':x-test-1' => array('hello1'), + ':x-Test-2' => array('hello2'), + 'content-type' => array('application/json'), + 'CONTENT-LENGTH' => array(1234), + 'oRiGin' => array('https://www.qiniu.com'), + 'ReFer' => array('www.qiniu.com'), + 'Last-Modified' => array('Mon, 06 Sep 2021 06:44:52 GMT'), + 'acCePt-ChArsEt' => array('utf-8'), + 'x-test-3' => array('hello3'), + 'cache-control' => array('no-cache', 'no-store'), + ); + + public function testNormalizeKey() + { + $except = array( + ':status', + ':x-test-1', + ':x-Test-2', + 'Content-Type', + 'Content-Length', + 'Origin', + 'Refer', + 'Last-Modified', + 'Accept-Charset', + 'X-Test-3', + 'Cache-Control' + ); + $actual = array_map(function ($str) { + return Header::normalizeKey($str); + }, array_keys($this->heads)); + $this->assertEquals($actual, $except); + } + + + public function testInvalidKeyName() + { + $except = array( + 'a:x-test-1', + ); + + $actual = array_map(function ($str) { + return Header::normalizeKey($str); + }, $except); + + $this->assertEquals($except, $actual); + } + + public function testGetRawData() + { + $header = new Header($this->heads); + foreach ($this->heads as $k => $v) { + $rawHeader = $header->getRawData(); + $this->assertEquals($v, $rawHeader[Header::normalizeKey($k)]); + } + } + + public function testOffsetExists() + { + $header = new Header($this->heads); + foreach (array_keys($this->heads) as $k) { + $this->assertNotNull($header[$k]); + } + + $except = array( + ':status', + ':x-test-1', + ':x-Test-2', + 'Content-Type', + 'Content-Length', + 'Origin', + 'Refer', + 'Last-Modified', + 'Accept-Charset', + 'X-Test-3', + 'Cache-Control' + ); + foreach ($except as $k) { + $this->assertNotNull($header[$k], $k." is null"); + } + } + + public function testOffsetGet() + { + $header = new Header($this->heads); + foreach ($this->heads as $k => $v) { + $this->assertEquals($v[0], $header[$k]); + } + + $this->assertNull($header['no-exist']); + } + + public function testOffsetSet() + { + $header = new Header($this->heads); + $header["X-Test-3"] = "hello"; + $this->assertEquals("hello", $header["X-Test-3"]); + $header["x-test-3"] = "hello test3"; + $this->assertEquals("hello test3", $header["x-test-3"]); + $header[":x-Test-2"] = "hello"; + $this->assertEquals("hello", $header[":x-Test-2"]); + $header[":x-test-2"] = "hello test2"; + $this->assertEquals("hello", $header[":x-Test-2"]); + } + + public function testOffsetUnset() + { + $header = new Header($this->heads); + unset($header["X-Test-3"]); + $this->assertFalse(isset($header["X-Test-3"])); + + $header = new Header($this->heads); + unset($header["x-test-3"]); + $this->assertFalse(isset($header["x-test-3"])); + + $header = new Header($this->heads); + unset($header[":x-test-2"]); + $this->assertTrue(isset($header[":x-Test-2"])); + + $header = new Header($this->heads); + unset($header[":x-Test-2"]); + $this->assertFalse(isset($header[":x-Test-2"])); + } + + public function testGetIterator() + { + $header = new Header($this->heads); + + $hasException = false; + try { + foreach ($header as $k => $v) { + $hasException = !isset($header[$k]); + } + } catch (\Exception $e) { + $hasException = true; + } + $this->assertFalse($hasException); + } + + public function testEmptyHeaderIterator() + { + $emptyHeader = new Header(); + + $hasException = false; + try { + foreach ($emptyHeader as $k => $v) { + $hasException = !isset($header[$k]); + } + } catch (\Exception $e) { + $hasException = true; + } + $this->assertFalse($hasException); + } + + public function testCount() + { + $header = new Header($this->heads); + + $this->assertEquals(count($this->heads), count($header)); + } + + public function testFromRaw() + { + $lines = array(); + foreach ($this->heads as $k => $vs) { + foreach ($vs as $v) { + array_push($lines, $k . ": " . $v); + } + } + $raw = implode("\r\n", $lines); + $headerFromRaw = Header::fromRawText($raw); + $this->assertEquals(new Header($this->heads), $headerFromRaw); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/HttpTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/HttpTest.php new file mode 100644 index 0000000..c122f8e --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/HttpTest.php @@ -0,0 +1,163 @@ +assertEquals(200, $response->statusCode); + $this->assertNotNull($response->body); + $this->assertNull($response->error); + } + + public function testGetQiniu() + { + $response = Client::get('upload.qiniu.com'); + $this->assertEquals(405, $response->statusCode); + $this->assertNotNull($response->body); + $this->assertNotNull($response->xReqId()); + $this->assertNotNull($response->xLog()); + $this->assertNotNull($response->error); + } + + public function testGetTimeout() + { + $reqOpt = new RequestOptions(); + $reqOpt->timeout = 1; + $response = Client::get('localhost:9000/timeout.php', array(), $reqOpt); + $this->assertEquals(-1, $response->statusCode); + } + + public function testGetRedirect() + { + $response = Client::get('localhost:9000/redirect.php'); + $this->assertEquals(200, $response->statusCode); + $this->assertEquals('application/json;charset=UTF-8', $response->normalizedHeaders['Content-Type']); + $respData = $response->json(); + $this->assertEquals('ok', $respData['msg']); + } + + public function testDelete() + { + $response = Client::delete('uc.qbox.me/bucketTagging', array()); + $this->assertEquals(401, $response->statusCode); + $this->assertNotNull($response->body); + $this->assertNotNull($response->error); + } + + public function testDeleteQiniu() + { + $response = Client::delete('uc.qbox.me/bucketTagging', array()); + $this->assertEquals(401, $response->statusCode); + $this->assertNotNull($response->body); + $this->assertNotNull($response->xReqId()); + $this->assertNotNull($response->xLog()); + $this->assertNotNull($response->error); + } + + public function testDeleteTimeout() + { + $reqOpt = new RequestOptions(); + $reqOpt->timeout = 1; + $response = Client::delete('localhost:9000/timeout.php', array(), $reqOpt); + $this->assertEquals(-1, $response->statusCode); + } + + + public function testPost() + { + $response = Client::post('qiniu.com', null); + $this->assertEquals(200, $response->statusCode); + $this->assertNotNull($response->body); + $this->assertNull($response->error); + } + + public function testPostQiniu() + { + $response = Client::post('upload.qiniu.com', null); + $this->assertEquals(400, $response->statusCode); + $this->assertNotNull($response->body); + $this->assertNotNull($response->xReqId()); + $this->assertNotNull($response->xLog()); + $this->assertNotNull($response->error); + } + + public function testPostTimeout() + { + $reqOpt = new RequestOptions(); + $reqOpt->timeout = 1; + $response = Client::post('localhost:9000/timeout.php', null, array(), $reqOpt); + $this->assertEquals(-1, $response->statusCode); + } + + public function testSocks5Proxy() + { + $reqOpt = new RequestOptions(); + $reqOpt->proxy = 'socks5://localhost:8080'; + $response = Client::post('qiniu.com', null, array(), $reqOpt); + $this->assertEquals(-1, $response->statusCode); + + $reqOpt->proxy_user_password = 'user:pass'; + $response = Client::post('qiniu.com', null, array(), $reqOpt); + $this->assertEquals(200, $response->statusCode); + } + + public function testPut() + { + $response = Client::PUT('uc.qbox.me/bucketTagging', null); + $this->assertEquals(401, $response->statusCode); + $this->assertNotNull($response->body); + $this->assertNotNull($response->error); + } + + public function testPutQiniu() + { + $response = Client::put('uc.qbox.me/bucketTagging', null); + $this->assertEquals(401, $response->statusCode); + $this->assertNotNull($response->body); + $this->assertNotNull($response->xReqId()); + $this->assertNotNull($response->xLog()); + $this->assertNotNull($response->error); + } + + + public function testPutTimeout() + { + $reqOpt = new RequestOptions(); + $reqOpt->timeout = 1; + $response = Client::put('localhost:9000/timeout.php', null, array(), $reqOpt); + $this->assertEquals(-1, $response->statusCode); + } + + public function testNeedRetry() + { + $testCases = array_merge( + array(array(-1, true)), + array_map(function ($i) { + return array($i, false); + }, range(100, 499)), + array_map(function ($i) { + if (in_array($i, array( + 501, 509, 573, 579, 608, 612, 614, 616, 618, 630, 631, 632, 640, 701 + ))) { + return array($i, false); + } + return array($i, true); + }, range(500, 799)) + ); + $resp = new Response(-1, 222, array(), '{"msg": "mock"}', null); + foreach ($testCases as $testCase) { + list($code, $expectNeedRetry) = $testCase; + $resp->statusCode = $code; + $msg = $resp->statusCode . ' need' . ($expectNeedRetry ? '' : ' NOT') . ' retry'; + $this->assertEquals($expectNeedRetry, $resp->needRetry(), $msg); + } + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ImageUrlBuilderTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ImageUrlBuilderTest.php new file mode 100644 index 0000000..486323c --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ImageUrlBuilderTest.php @@ -0,0 +1,263 @@ + + */ +class ImageUrlBuilderTest extends TestCase +{ + /** + * 缩略图测试 + * + * @test + * @return void + * @author Sherlock Ren + */ + public function testThumbutl() + { + $imageUrlBuilder = new \Qiniu\Processing\ImageUrlBuilder(); + $url = 'http://78re52.com1.z0.glb.clouddn.com/resource/gogopher.jpg'; + $url2 = $url . '?watermark/1/gravity/SouthEast/dx/0/dy/0/image/' + . 'aHR0cDovL2Fkcy1jZG4uY2h1Y2h1amllLmNvbS9Ga1R6bnpIY2RLdmRBUFc5cHZZZ3pTc21UY0tB'; + // 异常测试 + $this->assertEquals($url, $imageUrlBuilder->thumbnail($url, 1, 0, 0)); + $this->assertEquals($url, \Qiniu\thumbnail($url, 1, 0, 0)); + + // 简单缩略测试 + $this->assertEquals( + $url . '?imageView2/1/w/200/h/200/ignore-error/1/', + $imageUrlBuilder->thumbnail($url, 1, 200, 200) + ); + $this->assertEquals( + $url . '?imageView2/1/w/200/h/200/ignore-error/1/', + \Qiniu\thumbnail($url, 1, 200, 200) + ); + + // 输出格式测试 + $this->assertEquals( + $url . '?imageView2/1/w/200/h/200/format/png/ignore-error/1/', + $imageUrlBuilder->thumbnail($url, 1, 200, 200, 'png') + ); + $this->assertEquals( + $url . '?imageView2/1/w/200/h/200/format/png/ignore-error/1/', + \Qiniu\thumbnail($url, 1, 200, 200, 'png') + ); + + // 渐进显示测试 + $this->assertEquals( + $url . '?imageView2/1/w/200/h/200/format/png/interlace/1/ignore-error/1/', + $imageUrlBuilder->thumbnail($url, 1, 200, 200, 'png', 1) + ); + $this->assertEquals( + $url . '?imageView2/1/w/200/h/200/format/png/ignore-error/1/', + \Qiniu\thumbnail($url, 1, 200, 200, 'png', 2) + ); + + // 图片质量测试 + $this->assertEquals( + $url . '?imageView2/1/w/200/h/200/format/png/interlace/1/q/80/ignore-error/1/', + $imageUrlBuilder->thumbnail($url, 1, 200, 200, 'png', 1, 80) + ); + $this->assertEquals( + $url . '?imageView2/1/w/200/h/200/format/png/interlace/1/ignore-error/1/', + \Qiniu\thumbnail($url, 1, 200, 200, 'png', 1, 101) + ); + + // 多参数测试 + $this->assertEquals( + $url2 . '|imageView2/1/w/200/h/200/ignore-error/1/', + $imageUrlBuilder->thumbnail($url2, 1, 200, 200) + ); + $this->assertEquals( + $url2 . '|imageView2/1/w/200/h/200/ignore-error/1/', + \Qiniu\thumbnail($url2, 1, 200, 200) + ); + } + + /** + * 图片水印测试 + * + * @test + * @param void + * @return void + * @author Sherlock Ren + */ + public function waterImgTest() + { + $imageUrlBuilder = new \Qiniu\Processing\ImageUrlBuilder(); + $url = 'http://78re52.com1.z0.glb.clouddn.com/resource/gogopher.jpg'; + $url2 = $url . '?imageView2/1/w/200/h/200/format/png/ignore-error/1/'; + $image = 'http://developer.qiniu.com/resource/logo-2.jpg'; + + // 水印简单测试 + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/', + $imageUrlBuilder->waterImg($url, $image) + ); + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/gravity/SouthEast/', + $imageUrlBuilder->waterImg($url, $image, 101) + ); + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==/', + $imageUrlBuilder->waterImg($url, $image, 101, 'sdfsd') + ); + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/', + \Qiniu\waterImg($url, $image) + ); + + // 横轴边距测试 + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/dx/10/', + $imageUrlBuilder->waterImg($url, $image, 100, 'SouthEast', 10) + ); + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/', + \Qiniu\waterImg($url, $image, 100, 'SouthEast', 'sad') + ); + + // 纵轴边距测试 + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/dx/10/dy/10/', + $imageUrlBuilder->waterImg($url, $image, 100, 'SouthEast', 10, 10) + ); + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/', + \Qiniu\waterImg($url, $image, 100, 'SouthEast', 'sad', 'asdf') + ); + + // 自适应原图的短边比例测试 + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/dx/10/dy/10/ws/0.5/', + $imageUrlBuilder->waterImg($url, $image, 100, 'SouthEast', 10, 10, 0.5) + ); + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/', + \Qiniu\waterImg($url, $image, 100, 'SouthEast', 'sad', 'asdf', 2) + ); + + // 多参数测试 + $this->assertEquals( + $url2 . '|watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/', + $imageUrlBuilder->waterImg($url2, $image) + ); + $this->assertEquals( + $url2 . '|watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/', + \Qiniu\waterImg($url2, $image) + ); + } + + /** + * 文字水印测试 + * + * @test + * @param void + * @return void + * @author Sherlock Ren + */ + public function waterTextTest() + { + $imageUrlBuilder = new \Qiniu\Processing\ImageUrlBuilder(); + $url = 'http://78re52.com1.z0.glb.clouddn.com/resource/gogopher.jpg'; + $url2 = $url . '?imageView2/1/w/200/h/200/format/png/ignore-error/1/'; + $text = '测试一下'; + $font = '微软雅黑'; + $fontColor = '#FF0000'; + + // 水印简单测试 + $this->assertEquals($url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/' + . 'fontsize/500/dissolve/100/gravity/SouthEast/', $imageUrlBuilder->waterText($url, $text, $font, 500)); + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/' + . 'dissolve/100/gravity/SouthEast/', + \Qiniu\waterText($url, $text, $font, 'sdf') + ); + + // 字体颜色测试 + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fontsize/500/fill/' + . 'I0ZGMDAwMA==/dissolve/100/gravity/SouthEast/', + $imageUrlBuilder->waterText($url, $text, $font, 500, $fontColor) + ); + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fill/I0ZGMDAwMA==' + . '/dissolve/100/gravity/SouthEast/', + \Qiniu\waterText($url, $text, $font, 'sdf', $fontColor) + ); + + // 透明度测试 + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fontsize/500/fill/I0ZGMDAwMA==' + . '/dissolve/80/gravity/SouthEast/', + $imageUrlBuilder->waterText($url, $text, $font, 500, $fontColor, 80) + ); + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fill/I0ZGMDAwMA==' + . '/gravity/SouthEast/', + \Qiniu\waterText($url, $text, $font, 'sdf', $fontColor, 101) + ); + + // 水印位置测试 + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fontsize/500/fill/I0ZGMDAwMA==' + . '/dissolve/80/gravity/East/', + $imageUrlBuilder->waterText($url, $text, $font, 500, $fontColor, 80, 'East') + ); + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fill/I0ZGMDAwMA==/', + \Qiniu\waterText($url, $text, $font, 'sdf', $fontColor, 101, 'sdfsdf') + ); + + // 横轴距离测试 + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fontsize/500/fill/I0ZGMDAwMA==' + . '/dissolve/80/gravity/East/dx/10/', + $imageUrlBuilder->waterText($url, $text, $font, 500, $fontColor, 80, 'East', 10) + ); + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fill/I0ZGMDAwMA==/', + \Qiniu\waterText($url, $text, $font, 'sdf', $fontColor, 101, 'sdfsdf', 'sdfs') + ); + + // 纵轴距离测试 + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fontsize/500/fill/I0ZGMDAwMA==' + . '/dissolve/80/gravity/East/dx/10/dy/10/', + $imageUrlBuilder->waterText($url, $text, $font, 500, $fontColor, 80, 'East', 10, 10) + ); + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fill/I0ZGMDAwMA==/', + \Qiniu\waterText($url, $text, $font, 'sdf', $fontColor, 101, 'sdfsdf', 'sdfs', 'ssdf') + ); + // 多参数测试 + $this->assertEquals( + $url2 . '|watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/' + . 'fontsize/500/dissolve/100/gravity/SouthEast/', + $imageUrlBuilder->waterText($url2, $text, $font, 500) + ); + $this->assertEquals( + $url2 . '|watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/' + . 'fontsize/500/dissolve/100/gravity/SouthEast/', + \Qiniu\waterText($url2, $text, $font, 500) + ); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/MiddlewareTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/MiddlewareTest.php new file mode 100644 index 0000000..819b8ea --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/MiddlewareTest.php @@ -0,0 +1,160 @@ + + */ + private $orderRecorder; + + /** + * @var string + */ + private $label; + + public function __construct(&$orderRecorder, $label) + { + $this->orderRecorder =& $orderRecorder; + $this->label = $label; + } + + public function send($request, $next) + { + $this->orderRecorder[] = "bef_" . $this->label . count($this->orderRecorder); + $response = $next($request); + $this->orderRecorder[] = "aft_" . $this->label . count($this->orderRecorder); + return $response; + } +} + +class MiddlewareTest extends TestCase +{ + public function testSendWithMiddleware() + { + $orderRecorder = array(); + + $reqOpt = new RequestOptions(); + $reqOpt->middlewares = array( + new RecorderMiddleware($orderRecorder, "A"), + new RecorderMiddleware($orderRecorder, "B") + ); + + $request = new Request( + "GET", + "https://qiniu.com/index.html", + array(), + null, + $reqOpt + ); + $response = Client::sendRequestWithMiddleware($request); + + $expectRecords = array( + "bef_A0", + "bef_B1", + "aft_B2", + "aft_A3" + ); + + $this->assertEquals($expectRecords, $orderRecorder); + $this->assertEquals(200, $response->statusCode); + } + + public function testSendWithRetryDomains() + { + $orderRecorder = array(); + + $reqOpt = new RequestOptions(); + $reqOpt->middlewares = array( + new Middleware\RetryDomainsMiddleware( + array( + "unavailable.phpsdk.qiniu.com", + "qiniu.com", + ), + 3 + ), + new RecorderMiddleware($orderRecorder, "rec") + ); + + $request = new Request( + "GET", + "https://fake.phpsdk.qiniu.com/index.html", + array(), + null, + $reqOpt + ); + $response = Client::sendRequestWithMiddleware($request); + + $expectRecords = array( + // 'fake.phpsdk.qiniu.com' with retried 3 times + 'bef_rec0', + 'aft_rec1', + 'bef_rec2', + 'aft_rec3', + 'bef_rec4', + 'aft_rec5', + + // 'unavailable.pysdk.qiniu.com' with retried 3 times + 'bef_rec6', + 'aft_rec7', + 'bef_rec8', + 'aft_rec9', + 'bef_rec10', + 'aft_rec11', + + // 'qiniu.com' and it's success + 'bef_rec12', + 'aft_rec13' + ); + + $this->assertEquals($expectRecords, $orderRecorder); + $this->assertEquals(200, $response->statusCode); + } + + public function testSendFailFastWithRetryDomains() + { + $orderRecorder = array(); + + $reqOpt = new RequestOptions(); + $reqOpt->middlewares = array( + new Middleware\RetryDomainsMiddleware( + array( + "unavailable.phpsdk.qiniu.com", + "qiniu.com", + ), + 3, + function () { + return false; + } + ), + new RecorderMiddleware($orderRecorder, "rec") + ); + + $request = new Request( + "GET", + "https://fake.phpsdk.qiniu.com/index.html", + array(), + null, + $reqOpt + ); + $response = Client::sendRequestWithMiddleware($request); + + $expectRecords = array( + // 'fake.phpsdk.qiniu.com' will fail fast + 'bef_rec0', + 'aft_rec1' + ); + $this->assertEquals($expectRecords, $orderRecorder); + $this->assertEquals(-1, $response->statusCode); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/PfopTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/PfopTest.php new file mode 100644 index 0000000..19bacc0 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/PfopTest.php @@ -0,0 +1,68 @@ +execute($bucket, $key, $fops); + $this->assertNull($error); + list($status, $error) = $pfop->status($id); + $this->assertNotNull($status); + $this->assertNull($error); + } + + + public function testPfops() + { + global $testAuth; + $bucket = 'testres'; + $key = 'sintel_trailer.mp4'; + $fops = array( + 'avthumb/m3u8/segtime/10/vcodec/libx264/s/320x240', + 'vframe/jpg/offset/7/w/480/h/360', + ); + $pfop = new PersistentFop($testAuth, null); + + list($id, $error) = $pfop->execute($bucket, $key, $fops); + $this->assertNull($error); + + list($status, $error) = $pfop->status($id); + $this->assertNotNull($status); + $this->assertNull($error); + } + + public function testMkzip() + { + global $testAuth; + $bucket = 'phpsdk'; + $key = 'php-logo.png'; + $pfop = new PersistentFop($testAuth, null); + + $url1 = 'http://phpsdk.qiniudn.com/php-logo.png'; + $url2 = 'http://phpsdk.qiniudn.com/php-sdk.html'; + $zipKey = 'test.zip'; + + $fops = 'mkzip/2/url/' . \Qiniu\base64_urlSafeEncode($url1); + $fops .= '/url/' . \Qiniu\base64_urlSafeEncode($url2); + $fops .= '|saveas/' . \Qiniu\base64_urlSafeEncode("$bucket:$zipKey"); + + list($id, $error) = $pfop->execute($bucket, $key, $fops); + $this->assertNull($error); + + list($status, $error) = $pfop->status($id); + $this->assertNotNull($status); + $this->assertNull($error); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ResumeUpTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ResumeUpTest.php new file mode 100644 index 0000000..6feee55 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ResumeUpTest.php @@ -0,0 +1,354 @@ +batch($ops); + } + + private static function getObjectKey($key) + { + $result = $key . rand(); + self::$keysToCleanup[] = $result; + return $result; + } + + public function test4ML() + { + $key = self::getObjectKey('resumePutFile4ML_'); + $upManager = new UploadManager(); + $token = self::$auth->uploadToken(self::$bucketName, $key); + $tempFile = qiniuTempFile(4 * 1024 * 1024 + 10); + $resumeFile = tempnam(sys_get_temp_dir(), 'resume_file'); + $this->assertNotFalse($resumeFile); + list($ret, $error) = $upManager->putFile( + $token, + $key, + $tempFile, + null, + 'application/octet-stream', + false, + $resumeFile + ); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + + $domain = getenv('QINIU_TEST_DOMAIN'); + $response = Client::get("http://$domain/$key"); + $this->assertEquals(200, $response->statusCode); + $this->assertEquals(md5_file($tempFile, true), md5($response->body(), true)); + unlink($tempFile); + } + + public function test4ML2() + { + $key = self::getObjectKey('resumePutFile4ML_'); + $cfg = new Config(); + $upManager = new UploadManager($cfg); + $token = self::$auth->uploadToken(self::$bucketName, $key); + $tempFile = qiniuTempFile(4 * 1024 * 1024 + 10); + $resumeFile = tempnam(sys_get_temp_dir(), 'resume_file'); + $this->assertNotFalse($resumeFile); + list($ret, $error) = $upManager->putFile( + $token, + $key, + $tempFile, + null, + 'application/octet-stream', + false, + $resumeFile + ); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + + $domain = getenv('QINIU_TEST_DOMAIN'); + $response = Client::get("http://$domain/$key"); + $this->assertEquals(200, $response->statusCode); + $this->assertEquals(md5_file($tempFile, true), md5($response->body(), true)); + unlink($tempFile); + } + + public function test4ML2WithProxy() + { + $key = self::getObjectKey('resumePutFile4ML_'); + $cfg = new Config(); + $upManager = new UploadManager($cfg); + $token = self::$auth->uploadToken(self::$bucketName, $key); + $tempFile = qiniuTempFile(4 * 1024 * 1024 + 10); + $resumeFile = tempnam(sys_get_temp_dir(), 'resume_file'); + $this->assertNotFalse($resumeFile); + list($ret, $error) = $upManager->putFile( + $token, + $key, + $tempFile, + null, + 'application/octet-stream', + false, + $resumeFile, + 'v2', + Config::BLOCK_SIZE, + $this->makeReqOpt() + ); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + + $domain = getenv('QINIU_TEST_DOMAIN'); + $response = Client::get("http://$domain/$key"); + $this->assertEquals(200, $response->statusCode); + $this->assertEquals(md5_file($tempFile, true), md5($response->body(), true)); + unlink($tempFile); + } + + // public function test8M() + // { + // $key = 'resumePutFile8M'; + // $upManager = new UploadManager(); + // $token = self::$auth->uploadToken(self::$bucketName, $key); + // $tempFile = qiniuTempFile(8*1024*1024+10); + // list($ret, $error) = $upManager->putFile($token, $key, $tempFile); + // $this->assertNull($error); + // $this->assertNotNull($ret['hash']); + // unlink($tempFile); + // } + + public function testFileWithFileType() + { + $config = new Config(); + $bucketManager = new BucketManager(self::$auth, $config); + + $testCases = array( + array( + "fileType" => 1, + "name" => "IA" + ), + array( + "fileType" => 2, + "name" => "Archive" + ), + array( + "fileType" => 3, + "name" => "DeepArchive" + ) + ); + + foreach ($testCases as $testCase) { + $key = self::getObjectKey('FileType' . $testCase["name"]); + $police = array( + "fileType" => $testCase["fileType"], + ); + $token = self::$auth->uploadToken(self::$bucketName, $key, 3600, $police); + $upManager = new UploadManager(); + list($ret, $error) = $upManager->putFile($token, $key, __file__, null, 'text/plain'); + $this->assertNull($error); + $this->assertNotNull($ret); + list($ret, $err) = $bucketManager->stat(self::$bucketName, $key); + $this->assertNull($err); + $this->assertEquals($testCase["fileType"], $ret["type"]); + } + } + + public function testResumeUploadWithParams() + { + $key = self::getObjectKey('resumePutFile4ML_'); + $upManager = new UploadManager(); + $policy = array('returnBody' => '{"hash":$(etag),"fname":$(fname),"var_1":$(x:var_1),"var_2":$(x:var_2)}'); + $token = self::$auth->uploadToken(self::$bucketName, $key, 3600, $policy); + $tempFile = qiniuTempFile(4 * 1024 * 1024 + 10); + $resumeFile = tempnam(sys_get_temp_dir(), 'resume_file'); + $this->assertNotFalse($resumeFile); + list($ret, $error) = $upManager->putFile( + $token, + $key, + $tempFile, + array("x:var_1" => "val_1", "x:var_2" => "val_2", "x-qn-meta-m1" => "val_1", "x-qn-meta-m2" => "val_2"), + 'application/octet-stream', + false, + $resumeFile + ); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + $this->assertEquals("val_1", $ret['var_1']); + $this->assertEquals("val_2", $ret['var_2']); + $this->assertEquals(basename($tempFile), $ret['fname']); + + $domain = getenv('QINIU_TEST_DOMAIN'); + $response = Client::get("http://$domain/$key"); + $this->assertEquals(200, $response->statusCode); + $this->assertEquals(md5_file($tempFile, true), md5($response->body(), true)); + $headers = $response->headers(); + $this->assertEquals("val_1", $headers["X-Qn-Meta-M1"]); + $this->assertEquals("val_2", $headers["X-Qn-Meta-M2"]); + unlink($tempFile); + } + + public function testResumeUploadV2() + { + $cfg = new Config(); + $upManager = new UploadManager($cfg); + $testFileSize = array( + config::BLOCK_SIZE / 2, + config::BLOCK_SIZE, + config::BLOCK_SIZE + 10, + config::BLOCK_SIZE * 2, + config::BLOCK_SIZE * 2.5 + ); + $partSize = 5 * 1024 * 1024; + foreach ($testFileSize as $item) { + $key = self::getObjectKey('resumePutFile4ML_'); + $token = self::$auth->uploadToken(self::$bucketName, $key); + $tempFile = qiniuTempFile($item); + $resumeFile = tempnam(sys_get_temp_dir(), 'resume_file'); + $this->assertNotFalse($resumeFile); + list($ret, $error) = $upManager->putFile( + $token, + $key, + $tempFile, + null, + 'application/octet-stream', + false, + $resumeFile, + 'v2', + $partSize + ); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + + $domain = getenv('QINIU_TEST_DOMAIN'); + $response = Client::get("http://$domain/$key"); + $this->assertEquals(200, $response->statusCode); + $this->assertEquals(md5_file($tempFile, true), md5($response->body(), true)); + unlink($tempFile); + } + } + + public function testResumeUploadV2WithParams() + { + $key = self::getObjectKey('resumePutFile4ML_'); + $upManager = new UploadManager(); + $policy = array('returnBody' => '{"hash":$(etag),"fname":$(fname),"var_1":$(x:var_1),"var_2":$(x:var_2)}'); + $token = self::$auth->uploadToken(self::$bucketName, $key, 3600, $policy); + $tempFile = qiniuTempFile(4 * 1024 * 1024 + 10); + $resumeFile = tempnam(sys_get_temp_dir(), 'resume_file'); + $this->assertNotFalse($resumeFile); + list($ret, $error) = $upManager->putFile( + $token, + $key, + $tempFile, + array("x:var_1" => "val_1", "x:var_2" => "val_2", "x-qn-meta-m1" => "val_1", "x-qn-meta-m2" => "val_2"), + 'application/octet-stream', + false, + $resumeFile, + 'v2' + ); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + $this->assertEquals("val_1", $ret['var_1']); + $this->assertEquals("val_2", $ret['var_2']); + $this->assertEquals(basename($tempFile), $ret['fname']); + + $domain = getenv('QINIU_TEST_DOMAIN'); + $response = Client::get("http://$domain/$key"); + $this->assertEquals(200, $response->statusCode); + $this->assertEquals(md5_file($tempFile, true), md5($response->body(), true)); + $headers = $response->headers(); + $this->assertEquals("val_1", $headers["X-Qn-Meta-M1"]); + $this->assertEquals("val_2", $headers["X-Qn-Meta-M2"]); + unlink($tempFile); + } + + // valid versions are tested above + // Use PHPUnit's Data Provider to test multiple Exception is better, + // but not match the test style of this project + public function testResumeUploadWithInvalidVersion() + { + $cfg = new Config(); + $upManager = new UploadManager($cfg); + $testFileSize = config::BLOCK_SIZE * 2; + $partSize = 5 * 1024 * 1024; + $testInvalidVersions = array( + // High probability invalid versions + 'v', + '1', + '2' + ); + + $expectExceptionCount = 0; + foreach ($testInvalidVersions as $invalidVersion) { + $key = self::getObjectKey('resumePutFile4ML_'); + $token = self::$auth->uploadToken(self::$bucketName, $key); + $tempFile = qiniuTempFile($testFileSize); + $resumeFile = tempnam(sys_get_temp_dir(), 'resume_file'); + $this->assertNotFalse($resumeFile); + try { + $upManager->putFile( + $token, + $key, + $tempFile, + null, + 'application/octet-stream', + false, + $resumeFile, + $invalidVersion, + $partSize + ); + } catch (\Exception $e) { + $isRightException = false; + $expectExceptionCount++; + while ($e) { + $isRightException = $e instanceof \UnexpectedValueException; + if ($isRightException) { + break; + } + $e = $e->getPrevious(); + } + $this->assertTrue($isRightException); + } + + unlink($tempFile); + } + $this->assertEquals(count($testInvalidVersions), $expectExceptionCount); + } + + private function makeReqOpt() + { + $reqOpt = new RequestOptions(); + $reqOpt->proxy = 'socks5://127.0.0.1:8080'; + $reqOpt->proxy_user_password = 'user:pass'; + return $reqOpt; + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ZoneTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ZoneTest.php new file mode 100644 index 0000000..fbab528 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ZoneTest.php @@ -0,0 +1,136 @@ +bucketName = $bucketName; + + global $bucketNameBC; + $this->bucketNameBC = $bucketNameBC; + + global $bucketNameNA; + $this->bucketNameNA = $bucketNameNA; + + global $bucketNameFS; + $this->bucketNameFS = $bucketNameFS; + + global $bucketNameAS; + $this->bucketNameAS = $bucketNameAS; + + global $accessKey; + $this->ak = $accessKey; + + $this->zone = new Zone(); + $this->zoneHttps = new Zone('https'); + } + + public function testUpHosts() + { + list($ret, $err) = Zone::queryZone($this->ak, 'fakebucket'); + $this->assertNull($ret); + $this->assertNotNull($err); + + $zone = Zone::queryZone($this->ak, $this->bucketName); + $this->assertContains('upload.qiniup.com', $zone->cdnUpHosts); + + $zone = Zone::queryZone($this->ak, $this->bucketNameBC); + $this->assertContains('upload-z1.qiniup.com', $zone->cdnUpHosts); + + $zone = Zone::queryZone($this->ak, $this->bucketNameFS); + $this->assertContains('upload-z2.qiniup.com', $zone->cdnUpHosts); + + $zone = Zone::queryZone($this->ak, $this->bucketNameNA); + $this->assertContains('upload-na0.qiniup.com', $zone->cdnUpHosts); + + $zone = Zone::queryZone($this->ak, $this->bucketNameAS); + $this->assertContains('upload-as0.qiniup.com', $zone->cdnUpHosts); + } + + public function testIoHosts() + { + $zone = Zone::queryZone($this->ak, $this->bucketName); + $this->assertEquals($zone->iovipHost, 'iovip.qbox.me'); + + $zone = Zone::queryZone($this->ak, $this->bucketNameBC); + $this->assertEquals($zone->iovipHost, 'iovip-z1.qbox.me'); + + $zone = Zone::queryZone($this->ak, $this->bucketNameFS); + $this->assertEquals($zone->iovipHost, 'iovip-z2.qbox.me'); + + $zone = Zone::queryZone($this->ak, $this->bucketNameNA); + $this->assertEquals($zone->iovipHost, 'iovip-na0.qbox.me'); + + $zone = Zone::queryZone($this->ak, $this->bucketNameAS); + $this->assertEquals($zone->iovipHost, 'iovip-as0.qbox.me'); + } + + public function testZonez0() + { + $zone = Zone::zonez0(); + $this->assertContains('upload.qiniup.com', $zone->cdnUpHosts); + } + + public function testZonez1() + { + $zone = Zone::zonez1(); + $this->assertContains('upload-z1.qiniup.com', $zone->cdnUpHosts); + } + + public function testZonez2() + { + $zone = Zone::zonez2(); + $this->assertContains('upload-z2.qiniup.com', $zone->cdnUpHosts); + } + + public function testZoneCnEast2() + { + $zone = Zone::zoneCnEast2(); + $this->assertContains('upload-cn-east-2.qiniup.com', $zone->cdnUpHosts); + } + + public function testZoneNa0() + { + $zone = Zone::zoneNa0(); + $this->assertContains('upload-na0.qiniup.com', $zone->cdnUpHosts); + } + + public function testZoneAs0() + { + $zone = Zone::zoneAs0(); + $this->assertContains('upload-as0.qiniup.com', $zone->cdnUpHosts); + } + + public function testQvmZonez0() + { + $zone = Zone::qvmZonez0(); + $this->assertContains('free-qvm-z0-xs.qiniup.com', $zone->srcUpHosts); + } + + public function testQvmZonez1() + { + $zone = Zone::qvmZonez1(); + $this->assertContains('free-qvm-z1-zz.qiniup.com', $zone->srcUpHosts); + } +} diff --git a/vendor/qiniu/php-sdk/tests/bootstrap.php b/vendor/qiniu/php-sdk/tests/bootstrap.php new file mode 100644 index 0000000..9859a81 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/bootstrap.php @@ -0,0 +1,61 @@ + 0) { + $length = min($rest_size, 4 * 1024); + if (fwrite($file, random_bytes($length)) == false) { + return false; + } + $rest_size -= $length; + } + } else if ($size > 0) { + fseek($file, $size - 1); + fwrite($file, ' '); + } + fclose($file); + return $fileName; +} diff --git a/vendor/qiniu/php-sdk/tests/mock-server/ok.php b/vendor/qiniu/php-sdk/tests/mock-server/ok.php new file mode 100644 index 0000000..5b0a65d --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/mock-server/ok.php @@ -0,0 +1,3 @@ += 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 deleted file mode 100644 index de8ce62..0000000 --- a/vendor/ralouphie/getallheaders/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "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 deleted file mode 100644 index c7285a5..0000000 --- a/vendor/ralouphie/getallheaders/src/getallheaders.php +++ /dev/null @@ -1,46 +0,0 @@ - '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 deleted file mode 100644 index c49a5d8..0000000 --- a/vendor/symfony/deprecation-contracts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -phpunit.xml diff --git a/vendor/symfony/deprecation-contracts/CHANGELOG.md b/vendor/symfony/deprecation-contracts/CHANGELOG.md deleted file mode 100644 index 7932e26..0000000 --- a/vendor/symfony/deprecation-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index ad85e17..0000000 --- a/vendor/symfony/deprecation-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index 4957933..0000000 --- a/vendor/symfony/deprecation-contracts/README.md +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index cc7cc12..0000000 --- a/vendor/symfony/deprecation-contracts/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "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 deleted file mode 100644 index d437150..0000000 --- a/vendor/symfony/deprecation-contracts/function.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * 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); - } -}