Airship\Installer\Install::testForTor PHP Method

testForTor() protected method

This will attempt to connect to a Tor Hidden Service, to see if Tor is available for use.
protected testForTor ( )
    protected function testForTor()
    {
        $guzzle = new Client();
        try {
            $response = $guzzle->get('http://duskgytldkxiuqc6.onion', ['curl' => [CURLOPT_PROXY => 'http://localhost:9050', CURLOPT_PROXYTYPE => CURLPROXY_SOCKS5_HOSTNAME, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPPROXYTUNNEL => true]]);
            $this->data['tor_installed'] = \stripos((string) $response->getBody(), 'Example rendezvous points page') !== false;
        } catch (\RuntimeException $e) {
            $this->data['tor_installed'] = false;
        }
    }