Embed icon indicating copy to clipboard operation
Embed copied to clipboard

v4 is missing doc on Dispatcher

Open Simon-L opened this issue 3 years ago • 0 comments

Hello, nice tool thanks for your work!

It took me a while to realize that the conversations in the issues and elsewhere mostly refer to v3 and I could not get implementing a custom Dispatcher to work.

Taken from the v3 Readme, I've tried many variations on this:

use Embed\Embed;
use Embed\Http\CurlDispatcher;

$dispatcher = new CurlDispatcher([
    CURLOPT_MAXREDIRS => 20,
....
    CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
]);

$info = Embed::create('http://example.com', null, $dispatcher);

First off, CurlDispatcher has been made final and thus cannot be extended. Here: https://github.com/oscarotero/Embed/commit/e32dc0c62c091b8680069002b1ef9187c5d6d159#diff-3afdff1b7be92454769200d4bb204c97abbdbab3e543018e7c729590e170bb95

For now I've reverted to v3.4.16 for my usecase.

Simon-L avatar May 08 '21 17:05 Simon-L