Oara\Network\Publisher\RentalCars::checkConnection PHP Метод

checkConnection() публичный Метод

Check the connection
public checkConnection ( )
    public function checkConnection()
    {
        // If not login properly the construct launch an exception
        $connection = false;
        $urls = array();
        $urls[] = new \Oara\Curl\Request('https://secure.rentalcars.com/affiliates/?master=1', array());
        $exportReport = $this->_client->get($urls);
        $doc = new \DOMDocument();
        @$doc->loadHTML($exportReport[0]);
        $xpath = new \DOMXPath($doc);
        $results = $xpath->query('//*[contains(concat(" ", normalize-space(@id), " "), " header_logout ")]');
        if ($results->length > 0) {
            $connection = true;
        }
        return $connection;
    }