WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

MaxMind\Db

Reader::findAddressInTree() private WC 1.0

{} Это метод класса: Reader{}

Хуков нет.

Возвращает

null. Ничего.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->findAddressInTree( $ipAddress );
$ipAddress (обязательный)
-

Код Reader::findAddressInTree() WC 5.4.1

<?php
private function findAddressInTree($ipAddress)
{
    $rawAddress = unpack('C*', inet_pton($ipAddress));

    $bitCount = \count($rawAddress) * 8;

    // The first node of the tree is always node 0, at the beginning of the
    // value
    $node = 0;

    $metadata = $this->metadata;

    // Check if we are looking up an IPv4 address in an IPv6 tree. If this
    // is the case, we can skip over the first 96 nodes.
    if ($metadata->ipVersion === 6) {
        if ($bitCount === 32) {
            $node = $this->ipV4Start;
        }
    } elseif ($metadata->ipVersion === 4 && $bitCount === 128) {
        throw new InvalidArgumentException(
            "Error looking up $ipAddress. You attempted to look up an"
            . ' IPv6 address in an IPv4-only database.'
        );
    }

    $nodeCount = $metadata->nodeCount;

    for ($i = 0; $i < $bitCount && $node < $nodeCount; ++$i) {
        $tempBit = 0xFF & $rawAddress[($i >> 3) + 1];
        $bit = 1 & ($tempBit >> 7 - ($i % 8));

        $node = $this->readNode($node, $bit);
    }
    if ($node === $nodeCount) {
        // Record is empty
        return [0, $i];
    } elseif ($node > $nodeCount) {
        // Record is a data pointer
        return [$node, $i];
    }
    throw new InvalidDatabaseException('Something bad happened');
}