Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122406 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id ECF911ADA70 for ; Sat, 17 Feb 2024 12:12:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1708169981; bh=KW9Cs6qwCRUOioicpN8vZbmJ1q63yZNl9PJptqHax+w=; h=Date:From:To:Subject:In-Reply-To:References:From; b=C46jbjNLqsfCDZ659ePm4eKk2uY3zy80+Q8T+F5sRXKAeTRpQCXl2KuaFRc7FZAb7 22kXVWBQWTnZVnlSp1ujm+dsEEZug9WPckidYa+7po1BOZoyfJogrG3A3C4UrS7UdQ cikeeWv96n6iPSMqPB52Wpq5gP08GLJjYfyW8W/bbD8CcYRmgiD90cWysoRG7eSd0+ 2u5goJaJXep4xp0fUWxGz2k5W5aJCeM0cW/d6A4S3HfZl3hi2uF1NSFXstdoU2pNAK T+8DFl0/RNaQv1lHv6NNF+eiB6e0d7jFEe57km+Cac/1sbTVXFPRp9oU1+EZGDIC5v xr2AwshSPEoZA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 96855180DC5 for ; Sat, 17 Feb 2024 03:39:40 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 17 Feb 2024 03:39:40 -0800 (PST) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4125ee9a53dso766075e9.2 for ; Sat, 17 Feb 2024 03:39:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708169977; x=1708774777; darn=lists.php.net; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=KW9Cs6qwCRUOioicpN8vZbmJ1q63yZNl9PJptqHax+w=; b=Suw0A8XFO62lQDz8Ct8gaHNm9H2EjYqAgNm8NCy07vj+Im+Y2dU7dgIjCOUbs3pHs+ nV3n7zsKgLJswzNlBoGjzeyfk6fzLaMva82eu0nUdtIYKtzrMiG5v+Pt2AIpeMLjv71h X+3PMLRNsUsvHj52mVZkLFyw6Z9L7fuHl5za1h/+/xSbnCXIwUdb2Nzmuu7gJOIRxaRr kzOd5n7oH3qkdi0welj9gsVxWKyxzqKwUHa5ZbTnvbYyfnCeRuqU2y83oZVyYfKnhE0+ S5G55vuZKufnRaPKhYKZUAby/99ReIyw4TXO4WuBA1BH6diXaTyQSSxO894gr+KUlSB9 HDZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708169977; x=1708774777; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KW9Cs6qwCRUOioicpN8vZbmJ1q63yZNl9PJptqHax+w=; b=AHA5bqEfavY0/FHPGy94JXDCcTAnFM970rZwdbc1FJROs9wLFC+DfBo1QbxTyKeUp4 p4Qhy0NbLx9L59zNKtPUl2Yp5bF24gUQzflDM/P/9agJoGY37nEgnIs/390P53uDr+1e 6e5wNtjZsjLMWYIK1wwxgLQ0xvIQegwdOWFvCR37WqQuNiIbwTpkNG5kqgYqp1lpGdvv XMBtBrCRChmboESI1wvxLlObE6v/oe8UxQ5dYCWf6+s04Jg9Xyp8CuYtnK7HubF5jXPI sJ1yO9TnsIIYZt0tP7JPGcys0oH2R4S3Hi0qH+lOrRWsn3/iA9MjHuAwAazWapdVbNX8 ACUA== X-Gm-Message-State: AOJu0Ywvh7HatfxqivJkGTDacmPlJloXckL1taDjXV+eTC8hWGIominS TBUskQQAAgQiI3K3P7aCBYYb7cQbCEw5+NOtAclOhoiT/HnmNlucK/BU1cuF X-Google-Smtp-Source: AGHT+IH/kGtZnuazOBAHD3oN0+70lCqRM+HtPD0IHTOvAeEJ1s7OtC55OzgrLGkuIUtJ+EvYp4uGQA== X-Received: by 2002:a05:600c:818:b0:40e:f9df:3521 with SMTP id k24-20020a05600c081800b0040ef9df3521mr5129593wmp.38.1708169976458; Sat, 17 Feb 2024 03:39:36 -0800 (PST) Received: from [127.0.0.1] (cpc83311-brig21-2-0-cust191.3-3.cable.virginm.net. [86.20.40.192]) by smtp.gmail.com with ESMTPSA id n14-20020a05600c3b8e00b00410709fa0d3sm5112481wms.33.2024.02.17.03.39.35 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 17 Feb 2024 03:39:36 -0800 (PST) Date: Sat, 17 Feb 2024 11:39:34 +0000 To: PHP internals Subject: [PHP-DEV] Re: [RFC] OOP API for cURL extension User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: <50553291-EF85-47CB-99DC-1C4407DE5BA7@gmail.com> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: rowan.collins@gmail.com (Rowan Tommins) On 16 February 2024 16:09:32 GMT, Rowan Tommins wrote: >public function executeAndReturn(): string >public function executeAndOutput(): void I guess I missed: public function executeToFile(Stream $fileHandle): void public function executeWithCallback(callable $wrIteFunction): void which would imply CURLOPT_FILE and CURLOPT_WRITEFUNCTION, respectively=2E From=20what I can see, these four modes are actually mutually exclusive (pop= ulating ch->handlers=2Ewrite->method) with whichever option is touched last= governing the actual behaviour of curl_exec()=2E For instance, setting CUR= LOPT_FILE to null or CURLOPT_RETURNTRANSFER to false always selects stdout = mode, effectively clearing any value set with CURLOPT_WRITEFUNCTION=2E Havi= ng separate execute methods would make that much more obvious=2E Incidentally, I notice there is currently some code in _php_curl_verify_ha= ndlers where a bad stream in CURLOPT_FILE will fall back to writing the res= ult to stdout=2E Is it me, or is that a really terrible idea, potentially e= xposing private data to the user? Should that scenario be promoted to an im= mediate false return in curl_exec, and Error in the new OO wrapper? Regards, --=20 Rowan Tommins [IMSoP]