Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122433 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 2B30B1ACEBF for ; Sun, 18 Feb 2024 22:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1708293969; bh=Bq9U94nZe3L56SYCXxMX5QouVQ/teiK6a3vwBR6OX1I=; h=Date:From:CC:Subject:In-Reply-To:References:From; b=YYHVvTYI97G3QbiP1BWoxv7y2Ljf40qjIPQoHM2O+WYJz5zj9lkv7OIyNezLEApwk b7enuoOzqxep2Oa4cJxtyqlLWBHCFXG4IA/tPlovtzajoebYGMWsgwcgciQVIdsKYZ vVyJduIqwLgJ2m/OU4oRf8s7r36e9bytcfbRKJiJT59bBnisOeOUWDZVbqcaCn4Zj6 S19aiOgqm5HaT+pwEkdf+YcUjNVmFd0Jv8UUcX1PFudCe6Kv2GKuEWpHcwkG8Jbi9q mA85SEhNNH1UqmnSKfzyHlejtZJ9EEJx8eC1vWkbg0pNCpf/VU//gD9klwyKGsMfNq jjE0jGI+pqJyw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9113C1805E6 for ; Sun, 18 Feb 2024 22:06:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: * X-Spam-Status: No, score=1.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, MISSING_HEADERS,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-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 ; Sun, 18 Feb 2024 14:06:05 -0800 (PST) Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-33d4c11bd34so348362f8f.3 for ; Sun, 18 Feb 2024 14:06:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708293960; x=1708898760; darn=lists.php.net; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:from:date:from:to:cc:subject:date :message-id:reply-to; bh=Bq9U94nZe3L56SYCXxMX5QouVQ/teiK6a3vwBR6OX1I=; b=U0F8DvBj9kP/LKV6JST2jtfY69dNQHHpksj5LeEsIqtTSyfy2aiSwal88ws63pj4VL bpOv7S0NBGZt+DdO2DVc184zwo2XaLw1XFwz1slgaiB6SFjdxRhf224+L4aJ0mJucsSy YXDE60x0blYm/x96PKlIOQ9LL+NOPe5SsklPZ+hZDLUI45Bb65hM90wggozspeiL6FGU b7clej4zrCzThkR+JMGvLEwsKkGu5uPXIl/czs47XDSHBIpXdtn/f38TTdkMmOEcO39N LdcSIY5lC0leuP2uC0y9PqIxzqRqzNfhBJl2cz2kaB0v6npQto45g6i6nWJuYRfMdsxp dHZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708293960; x=1708898760; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:from:date:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Bq9U94nZe3L56SYCXxMX5QouVQ/teiK6a3vwBR6OX1I=; b=kvkvhqOTQRBnSE+4z7DKR2iHqKXHbYz7wppgQSIdYncyz+Wc3esqzLoUFfxvTN/xHQ E5TomeEYtvBcRu4JNivBYDtPIinorT1dnDSY87qac5+PJTaMH9KLVy1opgRMGDRxafju 9jShE2bv+jXKWeFUjpp6UtLzsLwLYbv6qRpqRgHL7g4c2ezUk7QMiD7haZ6PeLU8qf7v HI1dLBqyaE2jMlVCTvUO/kUz5bk6INU+POqMR6i+ps7AhUFIx6TS6LPSXQOl5iv+AYC7 0bw1cM+uTR19GR/E4kyyfBKvdipxR68ZEm0M4PaBbdAZpwK+sVusOq91cWMQfTAA6d+L seXg== X-Gm-Message-State: AOJu0YxtroiY5VKxnbw8FFhElHhw6+/5ytYIc6o8sGT5I2Dj1fpns3Sa NVT1KJ0T9M8dOhEWRpcma5jpCV+YlCc0c0kxR5ZIQLDkzCuckkzMFGQZ4Oj/ X-Google-Smtp-Source: AGHT+IGg+t+7yhVFVmkhcBM5h/ZOdJ+GvlVpIW+Tj8xEaKpB3twexLkhuo/Dw/iyWgiT8dL9FLL4pg== X-Received: by 2002:a5d:5148:0:b0:33d:374f:83ee with SMTP id u8-20020a5d5148000000b0033d374f83eemr2766975wrt.4.1708293960397; Sun, 18 Feb 2024 14:06:00 -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 h15-20020adffa8f000000b0033b75d0993esm8498907wrr.74.2024.02.18.14.05.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Feb 2024 14:06:00 -0800 (PST) Date: Sun, 18 Feb 2024 22:05:56 +0000 CC: internals@lists.php.net Subject: Re: [PHP-DEV] Re: [RFC] OOP API for cURL extension User-Agent: K-9 Mail for Android In-Reply-To: References: <9bc2d842-5f56-4062-8b21-3b41310f2c86@app.fastmail.com> Message-ID: 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 18 February 2024 15:26:37 GMT, Lynn wrote: > Having a lot of setters for options might make it really hard to find th= e >methods you're looking for in terms of auto-complete in your IDE=2E=20 I think it would be significantly better for that purpose than what we hav= e now, because there would be a lot fewer methods than there are current op= tion constants=2E=20 Firstly, because most of the methods would cover multiple overlapping or r= elated options - e=2Eg=2E setHttpMethod(string $method) covers CURLOPT_POST= , CURLOPT_PUT, CURLOPT_CUSTOMREQUEST, and CURLOPT_HTTPGET; setBasicAuth($us= ername, $password) combines CURLOPT_HTTPAUTH, CURLOPT_USERNAME, and CURLOPT= _PASSWORD=2E Secondly, because some functionality that's not used as often can just be = left to the curl_setopt equivalents forever, e=2Eg=2E we don't need new met= hods for CURLOPT_DNS_SHUFFLE_ADDRESSES, CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, = etc, etc=2E The initial aim could be to cover, say, the 10 most commonly used settings= - things like choosing the request method, and including custom request he= aders=2E Over time, we could add more methods for common tasks, but continu= e adding constants / enum cases for more obscure features of the library=2E > Would it >make sense to split options into a separate object (or perhaps multiple), >that could in theory also be shared between different CurlHandle instance= s? While I'm not against splitting things up into more objects, I think that = becomes a much bigger task to define what goes in each, and harder to do ha= lf-way=2E My gut feeling is that it would descend into a lot of bikesheddin= g, and stop us making progress; whereas adding a few methods for common use= cases could present a real quick win=2E Regards, --=20 Rowan Tommins [IMSoP]