Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127775 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 lists.php.net (Postfix) with ESMTPS id 96A001A00BC for ; Fri, 27 Jun 2025 16:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1751042137; bh=NMfiJ/nf6Q+8wfSwd3EBH28Yh+8Z+syRjgrdLXVe4Lw=; h=From:To:References:In-Reply-To:Subject:Date:From; b=afz3JkvBDAO6WIfuaQt9NVsO4OHnCvQqGFmbfKf9FydlsQeY+QPZzSFTmOsJ61RO4 2yh3YImPAedHdMXSav1ExtxZWhU0uCUHWFXhYBbCwXab1BO8Ko7Qa8LDg86oljUgDw KDTYdTniSbqQ2bMD7cNmsFUtm8V3CVC3pYtGjiYim1st12FCMryAZSlbeTH99/yCGy 4xLn/VCTubKHGwBuAqQQBcN8ptq+rUp7+TELLydszwPz07BdNIMlifYSWNO3Sz2NrH 1eANyd8Ja6PXXUCytRW6Ock9mn5BGr0BIDxsQ+/CiOjT6XE9NJzVSFpbx0uzlsJDF6 emvedQ3V/bipA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7994F180087 for ; Fri, 27 Jun 2025 16:35:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_PDS_PRO_TLD autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from beige.elm.relay.mailchannels.net (beige.elm.relay.mailchannels.net [23.83.212.16]) (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 ; Fri, 27 Jun 2025 16:35:35 +0000 (UTC) X-Sender-Id: yszpovajlk|x-authuser|juris@glaive.pro Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 3DAF71A59A9; Fri, 27 Jun 2025 16:37:29 +0000 (UTC) Received: from server52.areait.lv (100-108-113-168.trex-nlb.outbound.svc.cluster.local [100.108.113.168]) (Authenticated sender: yszpovajlk) by relay.mailchannels.net (Postfix) with ESMTPA id 6B1AD1A4BE3; Fri, 27 Jun 2025 16:37:27 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1751042247; a=rsa-sha256; cv=none; b=RdtHIdU0fMGJN7jGltaIifBuds4apJqfDBpklkbJnGcDcwQ3X3Dyi92QUvJ3+xKY/O7c1d DuXS7czRkodlzpD32JkCiZoreEmj990btTQCpHMcs1eaaOV00ZrdgYPB5siDNuoy45zTWn bF1EtHkkwPq5BSnZdL4QpNCmXlw52vf6m21WVDCA2FzcG2V1TAgCTp0lf2QELSzRbjFo8x yE9fr5B090jqIOjFN8fHkhriNguJSKhk87BeDSZ9HiiWkrRY1MJnXC/+I02/H2yuo4JdQW yXIgD5/JOGE2cXs8RsoCIcjCwCXxW0UD5jfhv4xMjlxVcBWdihluAbjEjGLYSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1751042247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=NMfiJ/nf6Q+8wfSwd3EBH28Yh+8Z+syRjgrdLXVe4Lw=; b=gtavGCTHn50MdErxxj3MByOavO2g1f6W3vE+cYfHPM+6ibNzaNGqsTVFVfuHlu3MCenQny xu/Ai3Tbai3p194GvfOOSHnQW5dkQndODSm/DMgKyF6qyCRMhqvX7suM7uWj9bXtnl3+mX XnrFG5QMRh0UaJRyMn3Ap3z02ylgUWGtbl85ARO5WDrwjFqxNlQOwhT/SqgC7N1EkIUYtL VdNabQA1j4D8PSVnrrZlyXw7SpVczVq5hT+akqxG1GHR3SalmNcaitazPvXnVkOWukjSuw XQQNLz+lV1YpfDvYhoXTQzbi7/erkdVkILMBZMACnCaLAFdqEqqBNdn/nds+UA== ARC-Authentication-Results: i=1; rspamd-6597f9cdc7-bfqfj; auth=pass smtp.auth=yszpovajlk smtp.mailfrom=juris@glaive.pro X-Sender-Id: yszpovajlk|x-authuser|juris@glaive.pro X-MC-Relay: Neutral X-MailChannels-SenderId: yszpovajlk|x-authuser|juris@glaive.pro X-MailChannels-Auth-Id: yszpovajlk X-Shelf-Quick: 715ef5a0390c0cbd_1751042248256_3741905288 X-MC-Loop-Signature: 1751042248256:2863406783 X-MC-Ingress-Time: 1751042248256 Received: from server52.areait.lv (server52.areait.lv [83.149.95.205]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.108.113.168 (trex/7.1.3); Fri, 27 Jun 2025 16:37:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=glaive.pro; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: Date:Subject:In-Reply-To:References:To:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=NMfiJ/nf6Q+8wfSwd3EBH28Yh+8Z+syRjgrdLXVe4Lw=; b=Pd8rK1ZnOxXndKoT7ReGYJnv8r DCes0sQu6H1gwEvZkw8D3eHksRRKoiWjmC9l1hyslPsBr8DuI2M0mM1ODsK6xMQqQqQ2K5j35a5hg oFfDIT/zb8EaE3qSYwkZL2myPpvmF19T6wJ44hCPE+4Y/COFGwz3GS/mOmdmmJsPU+rU34kPtOFWK QUQZdcCBF0N1V+Vrz68qM1hcN/Hp2vaMt7UcJkPhAC6Enjod0HWRq5UhL1Tw7xbVtRiqsRen2Bqpt +QdTi1hRyg7/9GrhOP/bLsYTuyuPrbIzJ7f7bSvH4JVCVDpU2MOdHdJg2mPgkf5nd99RZVUSr0XpL aqqZcJwg==; Received: from [77.93.29.116] (port=60633 helo=LAPTOPHKIOPCGI) by server52.areait.lv with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1uVC4r-00000009Gn2-2pXy; Fri, 27 Jun 2025 19:37:25 +0300 To: , "'PHP internals'" References: In-Reply-To: Subject: RE: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2 Date: Fri, 27 Jun 2025 19:37:23 +0300 Message-ID: <0f9801dbe781$c2d862c0$48892840$@glaive.pro> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQK+i+6J0NZfnU8guLnzBR9n2TndzbJR4G0w Content-Language: lv X-AuthUser: juris@glaive.pro From: juris@glaive.pro ("Juris Evertovskis") -----Original Message----- From: Eric Norris =20 Sent: Thursday, June 26, 2025 7:25 PM To: PHP internals Subject: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2 > I'd like to formally propose a restart of the original object-oriented = curl API RFC=20 Cool. Calling functions with object as an argument to modify it's state = feels very C-ish and wildly different from how contemporary PHP is = usually written. So even a 1:1 translation into a more familiar API is = welcome. It still feels a bit unfamiliar to me that part of the response (the = body) is returned from `execute()` while the other stuff (like the = status code) is stored in the state of the Handle instance. Is this = statefulness suggested by libcurl and reflects it's object? Or is it a = choice on the PHP side? I'm just wondering, this is probably not = something that should be changed on the Handle class but maybe on some = new layer. The enums that you propose are backed. It seems appropriate in the sense = of continuity, but is there a need for that? I'd argue that option names = like AbstractUnixSocket or AutoReferer are values per se and there is no = usable meaning for those integer values behind them. Maybe the = translation to numeric constants (assuming it's necessary) can be done = internally (in the Handle) via a `match` or `switch` statement and let's = have pure enums? I see that the option setters return ` \Curl\Handle`, but it is a bit = unclear whether it will actually return `static`, `self` or `$this`. I = assume the latter but it would be nice to document that we're mutating = the same object. > Should we organize the curl option enumerations by value type? Or have = a single enumeration for all curl_setopt options and another for all = curl_multi_setopt options? In fact I would expect a single `->setOption()` instead of the type = specific ones. Having to specify the argument type in the setter name = and/or the enum name doesn't sound very enjoyable to me. BR, Juris