1

这是他们的样本,我不知道如何让它工作。 http://aws.amazon.com/code/AWIS/402

一直显示: Usage: $argv[0] ACCESS_KEY_ID SECRET_ACCESS_KEY site\n 不工作,当你填写:

 $urlInfo = new UrlInfo("myaccessKeyId", "mysecretAccessKey", "stackoverflow.com");

我该如何解决这个问题?

 public function UrlInfo($accessKeyId, $secretAccessKey, $site) {
        $this->accessKeyId = $accessKeyId;
        $this->secretAccessKey = $secretAccessKey;
        $this->site = $site;
    }

/**
 * Get site info from AWIS.
 */ 
public function getUrlInfo() {
    $queryParams = $this->buildQueryParams();
    $sig = $this->generateSignature($queryParams);
    $url = 'http://' . self::$ServiceHost . '/?' . $queryParams . 
        '&Signature=' . $sig;
    $ret = self::makeRequest($url);
    echo "\nResults for " . $this->site .":\n\n";
    self::parseResponse($ret);
}
4

1 回答 1

1

该脚本旨在从命令行运行,如下所示:

php urlinfo.php ACCESS_KEY_ID SECRET_ACCESS_KEY site

它在自述文件中。如果你只是想使用这个类,你应该把 php 文件中第 122 行之后的东西拿出来。

于 2012-09-11T03:04:48.283 回答