From c6e03dffa3287da23b5e540c4d42824a53423250 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Fri, 13 May 2022 09:36:52 +1200 Subject: [PATCH] FIX Update oembed config --- _config/oembed.yml | 14 ++------------ composer.json | 2 +- tests/OEmbedTest.php | 28 ++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 tests/OEmbedTest.php diff --git a/_config/oembed.yml b/_config/oembed.yml index 2acada5..dcaea96 100644 --- a/_config/oembed.yml +++ b/_config/oembed.yml @@ -8,16 +8,6 @@ Only: --- SilverStripe\Core\Injector\Injector: # Configure the CWP proxy if defined - Embed\Http\DispatcherInterface: - class: Embed\Http\CurlDispatcher + Psr\Http\Client\ClientInterface.oembed: constructor: - config: - # CURLOPT_PROXY = 10004 - 10004: '`SS_OUTBOUND_PROXY`' - # CURLOPT_PROXYPORT = 59 - 59: '`SS_OUTBOUND_PROXY_PORT`' - - # Provide dispatcher to Embeddable implementations - SilverStripe\View\Embed\Embeddable: - properties: - Dispatcher: '%$Embed\Http\DispatcherInterface' + - proxy: '`SS_OUTBOUND_PROXY`:`SS_OUTBOUND_PROXY_PORT`' diff --git a/composer.json b/composer.json index 3d03139..6f58d49 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ ], "require": { "php": "^7.3 || ^8.0", - "silverstripe/framework": "^4.10", + "silverstripe/framework": "^4.11", "silverstripe/admin": "^1.10", "silverstripe/hybridsessions": "^2", "silverstripe/environmentcheck": "^2", diff --git a/tests/OEmbedTest.php b/tests/OEmbedTest.php new file mode 100644 index 0000000..2643028 --- /dev/null +++ b/tests/OEmbedTest.php @@ -0,0 +1,28 @@ +getProperty('client'); + $reflProperty->setAccessible(true); + $crawler = Injector::inst()->get(Crawler::class); + $client = $reflProperty->getValue($crawler); + $this->assertSame(Client::class, get_class($client)); + } +}