Skip to content

Commit

Permalink
FIX: Now using latest guzzle
Browse files Browse the repository at this point in the history
  • Loading branch information
Mellisa Hankins committed Dec 10, 2015
1 parent 8475555 commit 8adc112
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
6 changes: 4 additions & 2 deletions code/Providers/Model/HTTP.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php namespace Milkyway\SS\SocialFeed\Providers\Model;

use GuzzleHttp\Client;
use GuzzleHttp\Message\ResponseInterface;
use Milkyway\SS\SocialFeed\Contracts\Provider;
use Psr\Http\Message\ResponseInterface;

/**
* Milkyway Multimedia
Expand All @@ -19,6 +19,8 @@ abstract class HTTP implements Provider {
protected $cache;
protected $textParser;

protected $embedWillBeAjax = true;

public function __construct($cache = 6) {
$this->cacheLifetime = $cache;
}
Expand Down Expand Up @@ -87,7 +89,7 @@ protected function getBodyFromCache($url, $settings = []) {
}

protected function parseResponse(ResponseInterface $response) {
return $response->json(['big_int_strings' => true,]);
return json_decode($response->getBody()->getContents(), true, 512, JSON_BIGINT_AS_STRING);
}

protected function isValid($body) {
Expand Down
16 changes: 5 additions & 11 deletions code/Providers/Model/Oauth.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php namespace Milkyway\SS\SocialFeed\Providers\Model;

use GuzzleHttp\HandlerStack;
use GuzzleHttp\Subscriber\Oauth\Oauth1;

/**
Expand Down Expand Up @@ -52,22 +53,15 @@ public function extendedPermissions($scopes = [], $noLiveRequest = true, $redire
return $this;
}

protected function http()
{
parent::http();

$this
->client
->getEmitter()
->attach(new Oauth1($this->credentials));
protected function getHttpSettings() {
$handlers = HandlerStack::create();

return $this->client;
}
$handlers->push(new Oauth1($this->credentials));

protected function getHttpSettings() {
$settings = [
'defaults' => [
'auth' => $this->accessToken ? 'oauth2' : 'oauth',
'handler' => $handlers,
],
];

Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
],
"require": {
"silverstripe/framework": "~3.1",
"silverstripe/cms": "~3.1",
"guzzlehttp/oauth-subscriber": "~0.2",
"guzzlehttp/oauth-subscriber": "~0.3",
"silverstripe-australia/gridfieldextensions": "~1",
"milkyway-multimedia/ss-mwm": "dev-master"
"milkyway-multimedia/ss-mwm": "~0.3"
},
"suggest": {
"league/oauth2-client": "You will need Oauth2 authentication to unlock additional items to pull from a provider (such as Facebook ratings)",
Expand Down

0 comments on commit 8adc112

Please sign in to comment.