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

Breadcrumb

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

function NoProxyPattern::getUrlData

Returns false is the url cannot be parsed, otherwise a data object

Return value

bool|stdClass

1 call to NoProxyPattern::getUrlData()
NoProxyPattern::test in vendor/composer/composer/src/Composer/Util/NoProxyPattern.php
Returns true if a URL matches the NO_PROXY pattern

File

vendor/composer/composer/src/Composer/Util/NoProxyPattern.php, line 74

Class

NoProxyPattern
Tests URLs against NO_PROXY patterns

Namespace

Composer\Util

Code

protected function getUrlData(string $url) {
    if (!($host = parse_url($url, PHP_URL_HOST))) {
        return false;
    }
    $port = parse_url($url, PHP_URL_PORT);
    if (empty($port)) {
        switch (parse_url($url, PHP_URL_SCHEME)) {
            case 'http':
                $port = 80;
                break;
            case 'https':
                $port = 443;
                break;
        }
    }
    $hostName = $host . ($port ? ':' . $port : '');
    [
        $host,
        $port,
        $err,
    ] = $this->splitHostPort($hostName);
    if ($err || !$this->ipCheckData($host, $ipdata)) {
        return false;
    }
    return $this->makeData($host, $port, $ipdata);
}

API Navigation

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