Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127762 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 BB1071A00BC for ; Thu, 26 Jun 2025 17:54:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1750960343; bh=JsJweJoFf6giZPnXJq9QbBNcBV+osQRZbNqpv1lwZ9c=; h=References:In-Reply-To:Reply-To:From:Date:Subject:To:Cc:From; b=PJpNPfk4OQs/nzY2RNT2LA1W/bN/vjH3fkScBBRtSOyI7hxuuKlrLcx7dYtU8v2FK /ocfoWBuOCf1Sjb0JzTRH1jd+MnWXlfaHXfMJUMbYBtc2NRDGX9ZUNzZfUwV781Hwh 8i7+IdpFWWNRP9YECJ9sw2l6aTibH+7Q5hV7oSi0BWwEHSQjfuae6HUaqJ5/NhHrs6 AVRzEve+Z4raYOsP+zCmMcT76/WG0hrJc0WXa28ChDTYydOBo0V3PtAPt/PnIgcVuN iGa8ENrLlcY+H7MuefpQmkQlWqlYqu/bHDl2WB7JUi+wt3ugxlYHBvaZ6nCxBkavGG 7teyVCAskoDIA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CF46B180576 for ; Thu, 26 Jun 2025 17:52:22 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, FREEMAIL_REPLYTO,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS 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 mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) (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 ; Thu, 26 Jun 2025 17:52:22 +0000 (UTC) Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-874a68f6516so102563239f.2 for ; Thu, 26 Jun 2025 10:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750960457; x=1751565257; darn=lists.php.net; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=gNoPs2EdxgUNKugSGCkiowvC8Qco+R2KVuC6Ymr7vf4=; b=i3geTN80GJ5S57ZTU90J/YstWyt9B5X3HHZDl3HXCv2WZEL5Dd1W0EGCf5e5PXC7mQ QYSXV+NIi+XWAsqIwtzalE+NhEDJZ6fTm+G443/sWHuJqQ82eit9riEfkg7f87sxdSFi yTSzvmw9UOqzKYMVwlmYML26t/ME1eTzVSQqC89jIWjtMuyBxSCw2d3HbR5xhAYYmFcr UaEeR0DlwHjamtgrg8mR9X8/07C1px4029CFo3tiCNrwqYzRJKqjZW9AmJvzPfD/w4I+ Pu72zbg7mLSzOZOKLukevYaRj+zH6hxCB3KJxgkvFFyLcl2Z02zlJDFzFAALRJe4/g7L CidA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750960457; x=1751565257; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gNoPs2EdxgUNKugSGCkiowvC8Qco+R2KVuC6Ymr7vf4=; b=RZ2VktS3qbBEVDD5CXblls4Q/m375il71lgzbcBBdkhsrRZBMhA3CSyoUVnPiyLmey oNIc/OGDjfc7wASt9a8ZWdQc1nHrMk/TFuW4BBIkO03UU7tvWQBeoEVhF8cbwoXl07bV ZLmTd/tU34Fzhdf3ImLgdWquA+8oa7pQcNuI9ccN+6KE+aYL5VQMPzMOzcrOKPaBXzeh bTsgakUjD10EuPtQHYaxVs1crE+lbuyoOs6A6MXhoSsdyMEeYHWDJpHLZ5I9R2hgTzYM ZHlAmV60BDB48ArjP70T1TcI0SkDEEH9cGLXnKBhwOOJQCM8hY+xZrWxdvVsE04mgWqV PCNQ== X-Gm-Message-State: AOJu0YxwcG2MiHiqDXbs62NoNzuR4gkOz74rg0JuoDQ1hlEAbJZn+ruC D4uZ019v16SUgQpAp9WbHMLpdqGxGI1IIdJOLeTy/+uAj8uaJcDlmIhNFsOjeKy6/36oIqMyuH/ slTqL1NFAJZKWfHoL6C8AvmcYLbH/tRZu1iLU X-Gm-Gg: ASbGncsfe1IQ+tgfEAA5PHULCTzWJYPY74BUydh1PUdylJM+Xnty+pRwbDEWGD343Oo beWE0msCJhCoGrVBNiFR+IFb8KtlHAP+5pZGry2FjabcuKfvgadxfB0/Xofc5HJKJor30ZkT/DG 9kMJQ/s1auMY5XKlny7Yy0HBXNTfGcpFzUB03aR4ZcQsuQGH3r8wiOHVjbFOUlpkd0I1/o/oLp1 P0V7g== X-Google-Smtp-Source: AGHT+IFX5qIvdfOfogC4NOikrYZDX38i3STYD09RetEjYtC+BSEiLgAa//v4Z/1RgC74a6EW52V7Epq+80EkRrJSPxU= X-Received: by 2002:a05:6e02:a:b0:3dd:f3e1:2899 with SMTP id e9e14a558f8ab-3df4ab4f22dmr4592275ab.2.1750960456984; Thu, 26 Jun 2025 10:54:16 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <22a4327d-b27d-4e24-b07a-ae380fe8a0c4@app.fastmail.com> In-Reply-To: <22a4327d-b27d-4e24-b07a-ae380fe8a0c4@app.fastmail.com> Reply-To: erictnorris@gmail.com Date: Thu, 26 Jun 2025 13:54:00 -0400 X-Gm-Features: Ac12FXwcdeQKuiDDFKusBVY9po2al6SO4ANnufz6hAM-QUF4rjyZ467zXdDNOGI Message-ID: Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Object-oriented curl API v2 To: Larry Garfield Cc: php internals Content-Type: text/plain; charset="UTF-8" From: eric.t.norris@gmail.com (Eric Norris) Thanks Larry! > 1. I don't think the Curl\Option namespace is necessary. They can just be in the main Curl namespace. I don't feel strongly here, but I thought it would be nice to group the enums (if we go the multiple enum route) for discoverability. Thoughts? > 2. Please don't name the exception "Exception". It needs some slightly more useful name, to avoid confusion in a file that also uses \Exception. Fair point! I could use the previous RFC's HandleException class name, barring your next point... > 3. I realize `Handle` is the name from the procedural API, but it's not very self-descriptive. Without knowing Curl, it's non-obvious that it's a self-executing request object. Is there a better name we could find while we're at it? I'm open to this, but I don't have a suggestion myself. > 4. Love the use of aviz. :-) Thanks :) I was happy to be able to use it here. > 5. Now here's the big one: Using enums rather than a bunch of constants is a good change. However, I feel like it doesn't go far enough. > ... > As a worst case, perhaps the top-20 options or so could be converted to methods/properties, and the rest left to be ugly flags? I think my hesitation here is related to Ben's sibling response: I want to thread the needle between making small improvements to the low-level API while translating them to object-oriented equivalents, and making a high-level API. The latter, I think, would invite a lot more discussion, and would be potentially hard to get right. That said, maybe your suggestion does thread that needle; having a method / property for the N most-used options is still relatively low-level since it's not expressing an opinion on how they should be used. I'm not sure.