Closed rafiki270 closed 10 years ago
Can't tell, the same code works for me: require_once(DIR . '/client/GitHubClient.php');
class Github { private $username = NULL; private $password = NULL;
private $client = NULL;
public function __construct($username = NULL, $password = NULL)
{
$this->username = $username;
$this->password = $password;
$this->client = new GitHubClient();
$this->client->setCredentials($username, $password);
}
public function listRepos()
{
return $this->client->repos->listYourRepositories();
}
}
$github = new Github('tan-tan-kanarek', '****'); var_dump($github->listRepos());
What is the error you get?
that's the thing ... it returns loads of public repos, not mine ... for example if I do this: curl -u "rafiki270:password" https://api.github.com/orgs/fuerteinternational
I get a full stat on my organisation but if I do it through this class I get only the publicly visible bit so my first thought was that the authentication doesn't work properly?
I get exactly 100 public repos if I do the same thing you did ... well, I did :) ... and I have verier the credential by using CURL directly from the command line ...
Sorry, you're right. See my fix: https://github.com/tan-tan-kanarek/github-php-client/commit/bf9673f63f0ed3b4ba4efceb823f3a19b189cb18
cheers! :)
Do you have an idea what might be wrong, I have checked the CURL and the username and password is being passed on ...