You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 28, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 28, 2022. It is now read-only.
I had the same issue -- it appears to be a design problem because authentication is not abstracted from Api. So for example, when you do:
$user = new User();
$user->setCredentials(new Authentication\Basic('username', 'password'));
/* This causes $this->authenticated = TRUE and
$this->authenticator to be an instance of AuthenticationInterface
in the Api class. All is good. */
//this will work
var_dump($user->isFollowing('octocat'));
//this will not
var_dump($user->emails()->all());
Why won't the last call work? Because User::emails() instantiates a new instance of Email, which also extends from Api. So the instance variables $this->authenticator and $this->authenticated are set to their default values of null and FALSE for the instance of Api that we are now using. So when Api::doRequest() runs the authentication information is no longer there, and not passed with the request.
For a one-off project I was doing I just implemented a hack in Api::doRequest() to set the credentials there, ensuring they are present in the requests I needed to make. The real solution is to abstract the authentication stuff out of Api.
Error: "Fatal error: Call to undefined method Buzz\Browser::createRequest() in /www/project/vendor/dsyph3r/github-api3-php/lib/GitHub/API/Api.php on line 232" for OAuth Credentials type.
Activity
bsatoris commentedon Jul 24, 2012
I had the same issue -- it appears to be a design problem because authentication is not abstracted from Api. So for example, when you do:
Why won't the last call work? Because User::emails() instantiates a new instance of Email, which also extends from Api. So the instance variables $this->authenticator and $this->authenticated are set to their default values of null and FALSE for the instance of Api that we are now using. So when Api::doRequest() runs the authentication information is no longer there, and not passed with the request.
For a one-off project I was doing I just implemented a hack in Api::doRequest() to set the credentials there, ensuring they are present in the requests I needed to make. The real solution is to abstract the authentication stuff out of Api.
sorbing commentedon Nov 7, 2013
Error: "Fatal error: Call to undefined method Buzz\Browser::createRequest() in /www/project/vendor/dsyph3r/github-api3-php/lib/GitHub/API/Api.php on line 232" for OAuth Credentials type.