さて、基本的に私はactivecollabフレームワークでxeroに接続するためのアプリケーションを構築しています。そして、 DavidPitmanによって作成されたxeroapiphpスクリプトをテストしています。そして、私はブラウザが応答する理由を調べようとしています(ただし、何もThe connection to the server was reset while the page was loading.
生成されず、何も取得しません)...liveheaders
firebug
(出典:iforce.co.nz)
これが使用されているコードのスニペットです。(XERO Apiプレビューアとopensslを使用する前に、すべてがセットアップされています。)
define('XERO_KEY','my-key-here'); //hidden for privacy reasons
define('XERO_SECRET','my-key-here'); //hidden for privacy reasons
define('XERO_PUBLIC_KEY_PATH', 'path/to/public.key');
define('XERO_PRIVATE_KEY_PATH', 'path/to/privatekey.pem');
$xero = new Xero(XERO_KEY, XERO_SECRET, XERO_PUBLIC_KEY_PATH, XERO_PRIVATE_KEY_PATH, 'xml' );
$organisation = $xero->organisation;
//echo the results back
if ( is_object($organisation) ) {
//use this to see the source code if the $format option is "xml"
echo htmlentities($organisation->asXML()) . "<hr />";
} else {
//use this to see the source code if the $format option is "json" or not specified
echo json_encode($organisation) . "<hr />";
}
そして私の問題は...error_log(php)が警告の一部のエラーを表示しないことです:
2012-07-23 21:59:42 Notice : Undefined index: port (at C:\xampp\htdocs\ac3\activecollab\3.1.10\modules\xero_invoice_manager\lib\xero\xero.class.php on 644 line)
xero.class.php行644のコード
/**
* parses the url and rebuilds it to be
* scheme://host/path
*/
public function get_normalized_http_url() {
$parts = parse_url($this->http_url);
$port = @$parts['port']; //this line says its undefined
$scheme = $parts['scheme'];
$host = $parts['host'];
$path = @$parts['path'];
$port or $port = ($scheme == 'https') ? '443' : '80';
if (($scheme == 'https' && $port != '443')
|| ($scheme == 'http' && $port != '80')) {
$host = "$host:$port";
}
return "$scheme://$host$path";
}
調査の結果、でprint_r
の結果を見つけました。$parts
preformatted tag
Array
(
[scheme] => https
[host] => api.xero.com
[path] => /api.xro/2.0/Organisation
)
同じ情報がライブサーバーで使用されます(過去数か月間)。しかし、xeroapiクラスはテストサーバーで機能していません。接続されない理由について誰かアドバイスがありますか?私はXAMPP Control Panel
Apacheをオンにして実行しport 80
ていPHP Version 5.3.8
ます。