This repository was archived by the owner on Mar 23, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +40
-12
lines changed
Expand file tree Collapse file tree 4 files changed +40
-12
lines changed Original file line number Diff line number Diff line change 2929 "ext-json" :" *" ,
3030 "ext-simplexml" :" *" ,
3131 "ext-zlib" : " *" ,
32- "chillerlan/php-http-message-utils " : " ^1.0 " ,
32+ "chillerlan/php-httpinterface " : " dev-main#e1a872e63fc8ee066163f8259a19defff2eb0683 " ,
3333 "chillerlan/php-settings-container" : " ^2.1" ,
3434 "psr/http-client" :" ^1.0" ,
3535 "psr/http-message" : " ^1.0" ,
3838 "require-dev" : {
3939 "chillerlan/php-dotenv" : " ^2.1" ,
4040 "guzzlehttp/guzzle" : " ^7.3" ,
41- "guzzlehttp/psr7" : " ^2.0.0-beta1" ,
4241 "phan/phan" : " ^4.0" ,
4342 "phpunit/phpunit" : " ^9.5"
4443 },
Original file line number Diff line number Diff line change 2525 </logging >
2626 <php >
2727 <const name =" TEST_IS_CI" value =" true" />
28- <const name =" TEST_CLIENT_FACTORY" value =" chillerlan\OAuthTest\GuzzleClientFactory " />
29- <const name =" REQUEST_FACTORY" value =" GuzzleHttp\Psr7\HttpFactory " />
30- <const name =" RESPONSE_FACTORY" value =" GuzzleHttp\Psr7\HttpFactory " />
31- <const name =" STREAM_FACTORY" value =" GuzzleHttp\Psr7\HttpFactory " />
32- <const name =" URI_FACTORY" value =" GuzzleHttp\Psr7\HttpFactory " />
28+ <const name =" TEST_CLIENT_FACTORY" value =" chillerlan\OAuthTest\ChillerlanHttpClientFactory " />
29+ <const name =" REQUEST_FACTORY" value =" chillerlan\HTTP\Psr17\RequestFactory " />
30+ <const name =" RESPONSE_FACTORY" value =" chillerlan\HTTP\Psr17\ResponseFactory " />
31+ <const name =" STREAM_FACTORY" value =" chillerlan\HTTP\Psr17\StreamFactory " />
32+ <const name =" URI_FACTORY" value =" chillerlan\HTTP\Psr17\UriFactory " />
3333 </php >
3434</phpunit >
Original file line number Diff line number Diff line change 1212
1313namespace chillerlan \OAuth \Core ;
1414
15- use GuzzleHttp \ Psr7 \ HttpFactory ;
15+ use chillerlan \ HTTP \ Psr17 \{ RequestFactory , StreamFactory , UriFactory } ;
1616use chillerlan \HTTP \Utils \Query ;
1717use chillerlan \OAuth \MagicAPI \{ApiClientException , EndpointMap , EndpointMapInterface };
1818use chillerlan \OAuth \Storage \OAuthStorageInterface ;
@@ -164,10 +164,9 @@ public function __construct(
164164
165165 // i hate this, but i also hate adding 3 more params to the constructor
166166 // no i won't use a DI container for this. don't @ me
167- $ factory = new HttpFactory ;
168- $ this ->requestFactory = $ factory ;
169- $ this ->streamFactory = $ factory ;
170- $ this ->uriFactory = $ factory ;
167+ $ this ->requestFactory = new RequestFactory ;
168+ $ this ->streamFactory = new StreamFactory ;
169+ $ this ->uriFactory = new UriFactory ;
171170
172171 $ this ->serviceName = (new ReflectionClass ($ this ))->getShortName ();
173172
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Class ChillerlanHttpClientFactory
4+ *
5+ * @created 01.04.2021
6+ * @author smiley <smiley@chillerlan.net>
7+ * @copyright 2021 smiley
8+ * @license MIT
9+ */
10+
11+ namespace chillerlan \OAuthTest ;
12+
13+ use chillerlan \HTTP \HTTPOptions ;
14+ use chillerlan \HTTP \Psr18 \CurlClient ;
15+ use Psr \Http \Client \ClientInterface ;
16+
17+ class ChillerlanHttpClientFactory implements OAuthTestHttpClientFactoryInterface{
18+
19+ /**
20+ * @inheritDoc
21+ */
22+ public static function getClient (string $ cfgdir ):ClientInterface {
23+ $ options = new HTTPOptions ;
24+ $ options ->ca_info = $ cfgdir .'/cacert.pem ' ;
25+ $ options ->user_agent = 'chillerlanPhpOAuth/4.0.0 +https://github.com/chillerlan/php-oauth-core ' ;
26+
27+ return new CurlClient ($ options );
28+ }
29+
30+ }
You can’t perform that action at this time.
0 commit comments