So I tried following the examples at: https://bitbucket.org/atlassian_tutorial/atlassian-oauth-examples/src/475271a77dce5dd2be887df8a2bfc57dd970aa7a/php?at=default
And I got everything setup, but whenever I hit 'authenticate', I get the following error in my error logs:
Using $this when not in object context in /srv/oauth/src/Atlassian/OAuthWrapper.php on line 76
I looked at the code to see what was causing the issue, but I don't see anything blatant. Has anyone else hit this issue? What did you guys do to get around/solve it?
Community moderators have prevented the ability to post new answers.
I ran into the same issue, and made a similar change. I added this near the beginning of getClient:
$privateKey = $this->privateKey;
and added a "use" clause to the signature_callback definition:
'signature_callback' => function($stringToSign, $key) use ($privateKey) {
And then I use $privateKey throughout instead of $this->privateKey. I don't know whether there's been a change in the very latest version of PHP, but my guess is that this slipped in as part of an untested refactor.
As a temporary solution I did the following (although technically that should be updated =P)
I went into the function getClient inside of OAuthWrapper.php and I replaced all '$this->privateKey' to '$pk' and at the beginning of the function I created a new variable '$pk' with the same contents as my other file.
Still running into issues using this example, but that's for another ticket =)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.