protected function getAuthToken()
    {
        $data = array(
            "Email"         => $this->username,
            "Passwd"        => $this->password,
            "accountType"   => "HOSTED_OR_GOOGLE",
            "source"        => $this->source,
            "service"       => "ac2dm"
        );

        $buzz = new Browser();
        $buzz->getClient()->setVerifyPeer(false);
        $buzz->getClient()->setTimeout($this->timeout);
        $response = $buzz->post("https://www.google.com/accounts/ClientLogin", array(), http_build_query($data));
        if ($response->getStatusCode() !== 200) {
            return false;
        }

        preg_match("/Auth=([a-z0-9_\-]+)/i", $response->getContent(), $matches);
        $this->authToken = $matches[1];

        return true;
    }
protected function getAuthToken()
    {
        $data = array(
            "Email"         => $this->username,
            "Passwd"        => $this->password,
            "accountType"   => "HOSTED_OR_GOOGLE",
            "source"        => $this->source,
            "service"       => "ac2dm"
        );

        $buzz = new Browser();
        $buzz->getClient()->setVerifyPeer(false);
        $buzz->getClient()->setTimeout($this->timeout);
        $response = $buzz->post("https://www.google.com/accounts/ClientLogin", array(), http_build_query($data));
        if ($response->getStatusCode() !== 200) {
            return false;
        }

        preg_match("/Auth=([a-z0-9_\-]+)/i", $response->getContent(), $matches);
        $this->authToken = $matches[1];

        return true;
    }
protected function getAuthToken ( ) { $ data = array ( "Email" => $ this -> username , "Passwd" => $ this -> password , "accountType" => "HOSTED_OR_GOOGLE" , "source" => $ this -> source , "service" => "ac2dm" ) ; $ buzz = new Browser ( ) ; $ buzz -> getClient ( ) -> setVerifyPeer ( false ) ; $ buzz -> getClient ( ) -> setTimeout ( $ this -> timeout ) ; $ response = $ buzz -> post ( "https://www.google.com/accounts/ClientLogin" , array ( ) , http_build_query ( $ data ) ) ; if ( $ response -> getStatusCode ( ) !== 200 ) { return false ; } preg_match ( "/Auth=([a-z0-9_\-]+)/i" , $ response -> getContent ( ) , $ matches ) ; $ this -> authToken = $ matches [ 1 ] ; return true ; }
Gets a valid authentication token

@return bool
Gets a valid authentication token