php - 使用git命令无法正常工作?

时间:2012-11-25 20:57:48

标签: php git api soundcloud

我正在尝试使用soundcloud api并对我的帐户进行身份验证,此网站https://github.com/mptre/php-soundcloud/wiki/Oauth-2解释了使用github中的git命令下载存储库。我已经尝试手动下载文件,但它们中有错误。这个命令似乎什么都不做:$ git clone git://github.com/mptre/php-soundcloud.git,实际上它给了我一个错误。

完整代码:

 <?
$ git clone git://github.com/mptre/php-soundcloud.git

$soundcloud = new Services_Soundcloud('somekey', 'someotherkey', 'wonderfulworldofchris.com/soundcloud');

$authorizeUrl = $soundcloud->getAuthorizeUrl();



?>

<a href="<?php echo $authorizeUrl; ?>">Connect with SoundCloud</a>

1 个答案:

答案 0 :(得分:3)

要下载存储库,您需要安装git - http://git-scm.com/

之后,从命令行获取代码就像git clone git://github.com/mptre/php-soundcloud.git一样简单。但是,这应该在命令行中完成,而不是在PHP代码中完成。

也可以将repo下载为zip文件:https://github.com/mptre/php-soundcloud/archive/master.zip

下载此项目后,您需要在应用程序中包含“Services_Soundcloud”。然后你应该能够做到

<?
$soundcloud = new Services_Soundcloud('somekey', 'someotherkey', 'wonderfulworldofchris.com/soundcloud');
$authorizeUrl = $soundcloud->getAuthorizeUrl();
?>