public function getAllURLs(string $suffix = '', 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 . $suffix;
} else {
$after[] = $url . $suffix;
}
}
if (!$doNotShuffle) {
\Airship\secure_shuffle($candidates);
\Airship\secure_shuffle($after);
}
foreach ($after as $url) {
$candidates[] = $url . $suffix;
}
} else {
$candidates = $this->urls;
if (!$doNotShuffle) {
\Airship\secure_shuffle($candidates);
}
foreach (\array_keys($candidates) as $i) {
$candidates[$i] .= $suffix;
}
}
return $candidates;
}