経由RETSに接続します。PHP - カントはPHRETS
を、私はに私のリストをダウンロードするには、この例を使用csv形式:
私は私のMLSボードからRETSのURL、ユーザ名とパスワードを得たが、私はまだ接続することはできません。
ここPHRETSライブラリを呼び出すときに私のコードはfalseを返します。
require_once("phrets.php");
// start rets connection
$rets = new phRETS;
echo "+ Connecting to {$rets_login_url} as {$rets_username}<br>\n";
$connect = $rets->Connect($rets_login_url, $rets_username, $rets_password);
if ($connect) {
echo " + Connected<br>\n";
}
else {
echo " + Not connected:<br>\n";
print_r($rets->Error());
exit;
}
I後藤ライブラリへと方法の接続を見て、そのコードはここにfalseを返した場合:
// make request to Login transaction
$result = $this->RETSRequest($this->capability_url['Login']);
if (!$result) {
return false;
}
そして私を私のRETSRequestメソッドを見ると、レスポンスコードが0でなく、レスポンスコードが0であるため、ここではfalseを返します。
if ($response_code != 200) {
$this->set_error_info("http", $response_code, $response_body);
return false;
}
ここで接続しようとしています:
if ($this->ua_auth == true) {
$session_id_to_calculate_with = "";
// calculate RETS-UA-Authorization header
$ua_a1 = md5($this->static_headers['User-Agent'] .':'. $this->ua_pwd);
$session_id_to_calculate_with = ($this->use_interealty_ua_auth == true) ? "" : $this->session_id;
$ua_dig_resp = md5(trim($ua_a1) .':'. trim($this->request_id) .':'. trim($session_id_to_calculate_with) .':'. trim($this->static_headers['RETS-Version']));
$request_headers .= "RETS-UA-Authorization: Digest {$ua_dig_resp}\r\n";
}
$this->last_request_url = $request_url;
curl_setopt($this->ch, CURLOPT_URL, $request_url);
curl_setopt($this->ch, CURLOPT_HTTPHEADER, array(trim($request_headers)));
// do it
$response_body = curl_exec($this->ch);
$response_code = curl_getinfo($this->ch, CURLINFO_HTTP_CODE);
なぜ接続できませんか?
URL、ユーザ名、パスワードを使用してhttp://retsmd.comでログインすることができました。私は本当にCSVの形式で私のリストを取得する必要があります。
私は私のサーバーにカールインストールされていない
を助けてください、私はこの方法でチェック:
Check to see if cURL is installed locally?
なぜdangodevのGithubからPHRETSライブラリをダウンロードしていますか?公式のPHRETS Githubをhttps://github.com/troydavisson/PHRETSでご利用ください。そこの文書も守ってください。また、PHRETS:1.xと2.0の2つのブランチがあります。また、それぞれに異なる文書があります。 –