CurlMultiHandler example


    public static function chooseHandler(): callable
    {
        $handler = null;

        if (\defined('CURLOPT_CUSTOMREQUEST')) {
            if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) {
                $handler = Proxy::wrapSync(new CurlMultiHandler()new CurlHandler());
            } elseif (\function_exists('curl_exec')) {
                $handler = new CurlHandler();
            } elseif (\function_exists('curl_multi_exec')) {
                $handler = new CurlMultiHandler();
            }
        }

        if (\ini_get('allow_url_fopen')) {
            $handler = $handler
                ? Proxy::wrapStreaming($handlernew StreamHandler())
                : new StreamHandler();
        }
Home | Imprint | This part of the site doesn't use cookies.