Skip to content

Commit aa9f887

Browse files
committed
resolving rebase conflicts
1 parent ff846d2 commit aa9f887

File tree

4 files changed

+14
-150
lines changed

4 files changed

+14
-150
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"silex/silex": "dev-master",
44
"symfony/twig-bridge": "2.1.*",
55
"bshaffer/oauth2-server-php": "v1.0",
6-
"bshaffer/oauth2-server-httpfoundation-bridge": "v1.0"
6+
"bshaffer/oauth2-server-httpfoundation-bridge": "v1.0",
7+
"guzzle/guzzle": "~3.7"
78
},
89
"autoload" : {
910
"psr-0": {

src/OAuth2Demo/Client/Controllers/RequestResource.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace OAuth2Demo\Client\Controllers;
44

55
use Silex\Application;
6+
use Guzzle\Http\Client;
67

78
class RequestResource
89
{
@@ -16,7 +17,6 @@ public function requestResource(Application $app)
1617
$twig = $app['twig']; // used to render twig templates
1718
$config = $app['parameters']; // the configuration for the current oauth implementation
1819
$urlgen = $app['url_generator']; // generates URLs based on our routing
19-
$curl = $app['curl']; // simple class used to make curl requests
2020

2121
// pull the token from the request
2222
$token = $app['request']->get('token');
@@ -29,7 +29,11 @@ public function requestResource(Application $app)
2929
$endpoint = 0 === strpos($apiRoute, 'http') ? $apiRoute : $urlgen->generate($apiRoute, array(), true);
3030

3131
// make the resource request via curl and decode the json response
32-
$response = $curl->request($endpoint, $config['resource_params'], $config['resource_method'], $config['curl_options']);
32+
$http = new Client();
33+
$method = $config['resource_method'];
34+
$request = $http->$method($endpoint, $config['resource_params'], $config['curl_options']);
35+
$response = $request->send();
36+
3337
$json = json_decode($response['response'], true);
3438

3539
$resource_uri = sprintf('%s%saccess_token=%s', $endpoint, false === strpos($endpoint, '?') ? '?' : '&', $token);

src/OAuth2Demo/Client/Controllers/RequestToken.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace OAuth2Demo\Client\Controllers;
44

55
use Silex\Application;
6+
use Guzzle\Http\Client;
67

78
class RequestToken
89
{
@@ -18,7 +19,6 @@ public function requestTokenWithAuthCode(Application $app)
1819
$twig = $app['twig']; // used to render twig templates
1920
$config = $app['parameters']; // the configuration for the current oauth implementation
2021
$urlgen = $app['url_generator']; // generates URLs based on our routing
21-
$curl = $app['curl']; // simple class used to make curl requests
2222

2323
$code = $app['request']->get('code');
2424

@@ -35,6 +35,11 @@ public function requestTokenWithAuthCode(Application $app)
3535
$grantRoute = $config['token_route'];
3636
$endpoint = 0 === strpos($grantRoute, 'http') ? $grantRoute : $urlgen->generate($grantRoute, array(), true);
3737

38+
$options = array('debug' => true, 'exceptions' => false, 'proxy' => '127.0.0.1:8888');
39+
$http = new Client(null);
40+
$request = $http->post($endpoint, null, $query, $options);
41+
$response = $request->send();
42+
3843
// make the token request via curl and decode the json response
3944
$response = $curl->request($endpoint, $query, 'POST', $config['curl_options']);
4045
$json = json_decode($response['response'], true);

src/OAuth2Demo/Client/Http/Curl.php

Lines changed: 0 additions & 146 deletions
This file was deleted.

0 commit comments

Comments
 (0)