Airship\Engine\Continuum\Channel::getAllURLs PHP Method

getAllURLs() public method

By default, this shuffles them randomly. If you're in tor-only mode, it prioritizes .onion domains first.
public getAllURLs ( boolean $doNotShuffle = false ) : array
$doNotShuffle boolean
return array
    public function getAllURLs(bool $doNotShuffle = false) : array
    {
        $state = State::instance();
        $candidates = [];
        if ($state->universal['tor-only']) {
            // Prioritize Tor Hidden Services
            $after = [];
            foreach ($this->urls as $url) {
                if (\Airship\isOnionUrl($url)) {
                    $candidates[] = $url;
                } else {
                    $after[] = $url;
                }
            }
            // Shuffle each array separately, to maintain priority;
            if (!$doNotShuffle) {
                \Airship\secure_shuffle($candidates);
                \Airship\secure_shuffle($after);
            }
            foreach ($after as $url) {
                $candidates[] = $url;
            }
        } else {
            // All URLs treated the same.
            $candidates = $this->urls;
            if (!$doNotShuffle) {
                \Airship\secure_shuffle($candidates);
            }
        }
        return $candidates;
    }