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

Breadcrumb

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

function NoProxyPattern::getRule

Finds or creates rule data for a hostname

Return value

null|stdClass Null if the hostname is invalid

1 call to NoProxyPattern::getRule()
NoProxyPattern::match in vendor/composer/composer/src/Composer/Util/NoProxyPattern.php
Returns true if the url is matched by a rule

File

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

Class

NoProxyPattern
Tests URLs against NO_PROXY patterns

Namespace

Composer\Util

Code

private function getRule(int $index, string $hostName) : ?stdClass {
    if (array_key_exists($index, $this->rules)) {
        return $this->rules[$index];
    }
    $this->rules[$index] = null;
    [
        $host,
        $port,
        $err,
    ] = $this->splitHostPort($hostName);
    if ($err || !$this->ipCheckData($host, $ipdata, true)) {
        return null;
    }
    $this->rules[$index] = $this->makeData($host, $port, $ipdata);
    return $this->rules[$index];
}

API Navigation

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