-
Notifications
You must be signed in to change notification settings - Fork 53
Fatal error: Class 'Login' not found #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You need to use namespace, i.e. |
You need to load |
Yep I`m doing that, otherwise I would not get this response I guess. |
No, |
Strange. Do you have error_reporting set to E_ALL and enabled display_errors? |
@TheZoker Try to dump the The library uses |
Try |
Oh, maybe I got it. Isn't session started somewhere earlier? I mean, your |
But I dont have any other |
Wordpress does not start it? Or maybe PHP's |
I see. So, session is somewhere already started before you load the github-api libs. I don't know the Wordpress, maybe there is some hook for plugins to load the libraries first. If not, you can try this nasty hack in here and let me know. public function getToken()
{
$token = $this->storage->get('auth.token');
if ($token === NULL) {
throw new Github\LogicException('Token has not been obtained yet.');
} elseif ($token instanceof \__PHP_Incomplete_Class) {
$token = unserialize(serialize($token));
}
return $token;
} |
Sorry, that's the frontend thing which I don't solve. |
I can`t test it, because I get this error: Thank you very much for your help! |
When stored as a Token object, can be unserialized as an __PHP_Incomplete_Class when session starts before the library is loaded.
@TheZoker The error is caused by the Same Origin Policy setting. It is not relevant to this library. Anyway, I released a new version 1.4.3 where is a token in session stored as an ordinary array. It prevents |
@milo Is there any way to generate and save a state without calling askPermissions() ? |
No, if you need a user's permissions. Btw. why do you access GitHub webpage by AJAX? You need to redirect a browser window. User will click 'Accept' on GitHub web and than will be redirected back to your site. |
Awesome framework!
But I have a issue:
When I try to use
Login::getToken()
I get the errorBut I included the class in the helper.php file:
The text was updated successfully, but these errors were encountered: