Oara\Network\Publisher\SkyScanner::checkConnection PHP 메소드

checkConnection() 공개 메소드

public checkConnection ( ) : boolean
리턴 boolean
    public function checkConnection()
    {
        //If not login properly the construct launch an exception
        $connection = true;
        $urls = array();
        $urls[] = new \Oara\Curl\Request('http://business.skyscanner.net/portal/en-GB/UK/Report/Show', array());
        $exportReport = $this->_client->get($urls);
        if (!\preg_match("/encrypedApiKey: \"(.*)?\",/", $exportReport[0], $match)) {
            $connection = false;
        } else {
            $this->_apiKey = $match[1];
        }
        return $connection;
    }