芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/public_html/vendor/sentry/sentry/src/HttpClient/HttpClientFactory.php
streamFactory = $streamFactory; $this->httpClient = $httpClient; $this->sdkIdentifier = $sdkIdentifier; $this->sdkVersion = $sdkVersion; } /** * {@inheritdoc} */ public function create(Options $options): HttpAsyncClientInterface { if (null === $options->getDsn()) { throw new \RuntimeException('Cannot create an HTTP client without the Sentry DSN set in the options.'); } if (null !== $this->httpClient && null !== $options->getHttpProxy()) { throw new \RuntimeException('The "http_proxy" option does not work together with a custom HTTP client.'); } $httpClient = $this->httpClient ?? $this->resolveClient($options); $httpClientPlugins = [ new HeaderSetPlugin(['User-Agent' => $this->sdkIdentifier . '/' . $this->sdkVersion]), new AuthenticationPlugin(new SentryAuthentication($options, $this->sdkIdentifier, $this->sdkVersion)), new RetryPlugin(['retries' => $options->getSendAttempts(false)]), new ErrorPlugin(['only_server_exception' => true]), ]; if ($options->isCompressionEnabled()) { $httpClientPlugins[] = new GzipEncoderPlugin($this->streamFactory); $httpClientPlugins[] = new DecoderPlugin(); } return new PluginClient($httpClient, $httpClientPlugins); } /** * @return ClientInterface|HttpAsyncClientInterface */ private function resolveClient(Options $options) { if (class_exists(SymfonyHttplugClient::class)) { $symfonyConfig = [ 'timeout' => $options->getHttpConnectTimeout(), 'max_duration' => $options->getHttpTimeout(), ]; if (null !== $options->getHttpProxy()) { $symfonyConfig['proxy'] = $options->getHttpProxy(); } return new SymfonyHttplugClient(SymfonyHttpClient::create($symfonyConfig)); } if (class_exists(GuzzleHttpClient::class)) { $guzzleConfig = [ GuzzleHttpClientOptions::TIMEOUT => $options->getHttpTimeout(), GuzzleHttpClientOptions::CONNECT_TIMEOUT => $options->getHttpConnectTimeout(), ]; if (null !== $options->getHttpProxy()) { $guzzleConfig[GuzzleHttpClientOptions::PROXY] = $options->getHttpProxy(); } return GuzzleHttpClient::createWithConfig($guzzleConfig); } if (class_exists(CurlHttpClient::class)) { $curlConfig = [ \CURLOPT_TIMEOUT => $options->getHttpTimeout(), \CURLOPT_CONNECTTIMEOUT => $options->getHttpConnectTimeout(), ]; if (null !== $options->getHttpProxy()) { $curlConfig[\CURLOPT_PROXY] = $options->getHttpProxy(); } return new CurlHttpClient(null, null, $curlConfig); } if (null !== $options->getHttpProxy()) { throw new \RuntimeException('The "http_proxy" option requires either the "php-http/curl-client", the "symfony/http-client" or the "php-http/guzzle6-adapter" package to be installed.'); } return HttpAsyncClientDiscovery::find(); } }