Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ProxyManager.php

function ProxyManager::getProxyForRequest

Returns a RequestProxy instance for the request url

Parameters

non-empty-string $requestUrl:

File

vendor/composer/composer/src/Composer/Util/Http/ProxyManager.php, line 67

Class

ProxyManager
@internal @author John Stevenson <john-stevenson@blueyonder.co.uk>

Namespace

Composer\Util\Http

Code

public function getProxyForRequest(string $requestUrl) : RequestProxy {
    if ($this->error !== null) {
        throw new TransportException('Unable to use a proxy: ' . $this->error);
    }
    $scheme = (string) parse_url($requestUrl, PHP_URL_SCHEME);
    $proxy = $this->getProxyForScheme($scheme);
    if ($proxy === null) {
        return RequestProxy::none();
    }
    if ($this->noProxy($requestUrl)) {
        return RequestProxy::noProxy();
    }
    return $proxy->toRequestProxy($scheme);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal