Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122377 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 05D6E1AD9EF for ; Thu, 15 Feb 2024 07:14:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1707981275; bh=PFm9lUlb711jhopl7VVSizgXK+gcjSXdH9c6WcqgZr0=; h=From:To:Subject:In-Reply-To:References:Date:From; b=nzGWrbS/K0LKqURNs0EvfS4Mrd4mLzcT0VHNoGjUq5kRGFXbiB7ZoRtiWXeAQJe3d 0c8ceQ0EF1dZVedZU7YY9HDjio55urm4mu/riEZ52H6sAzvPvHzOhOWi0Z60Qh6La4 01twQe88hJyeeh2i59HKyWikKNJ/KhIDIr6eSRovMlngy53X5Qa7esBxoeSgoYmxFd YHPnIl3A9DOqO23stLdv2UhOB3aipl/eiy69VcYXphp5M9WQaO7F+tQkuVvrDBHU3Q NIBfxkH7CjSueK1f0ctLbO2yHNju605jN7NlJoiyGQSsEoTUmFt9xg+rqX+vRKJAW8 DHCxlVkdcK5qw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1946F1824B9 for ; Wed, 14 Feb 2024 23:14:35 -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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,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 shout01.mail.de (shout01.mail.de [62.201.172.24]) (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 ; Wed, 14 Feb 2024 23:14:34 -0800 (PST) Received: from postfix01.mail.de (postfix01.bt.mail.de [10.0.121.125]) by shout01.mail.de (Postfix) with ESMTP id 2B326241106; Thu, 15 Feb 2024 08:14:32 +0100 (CET) Received: from smtp01.mail.de (smtp03.bt.mail.de [10.0.121.213]) by postfix01.mail.de (Postfix) with ESMTP id 10F9F801CF; Thu, 15 Feb 2024 08:14:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.de; s=mailde202009; t=1707981272; bh=PFm9lUlb711jhopl7VVSizgXK+gcjSXdH9c6WcqgZr0=; h=Message-Id:From:To:Subject:Date:From:To:CC:Subject:Reply-To; b=6R0K24Ay6YY5sEykxJx7+EUDEY1aC/tNWT6NrgN+UzO5tHER/VFB/SS2BwC0FE1QX YiXBLEgj05FINFvmY8VLnH+pyzz1kV+1fK7XMVKrdHNcNRtuKRrDmNox6Xz1zzjRX7 miH6Ee6126pauPI4VYS8X+dEX5vjeuNz4EQtURmNr+6wr2KeAD33Yp6r7K4x4yAjES n+6YQGFOSfBE4dKcWErwOARKQMfBjiCNaobHW3nTxsrsfyG3bNF0J5IyMBU3DQkLFU BPDPQof7FtspRYlvg8i+QNeFD/d/0KZpd270rjZFA6nDYKO6rgTPRXbBUX9WCIbqO+ DlIOOOd6HAA2Q== Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp01.mail.de (Postfix) with ESMTPSA id D004D240A7D; Thu, 15 Feb 2024 08:14:31 +0100 (CET) Message-ID: <3b6f13706ccce7b6c52f4477940b950b4ebba600@mail.de> To: pollita@php.net, internals@lists.php.net Subject: Re: [RFC] OOP API for cURL extension X-Priority: 3 In-Reply-To: References: Date: Thu, 15 Feb 2024 08:14:31 +0100 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Mailing-List: contact internals-help@lists.php.net; run by mlmmj Precedence: bulk list-help: list-unsubscribe: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 1600 X-purgate-ID: 154282::1707981271-326251F9-E71B7EA9/0/0 From: christian.stoller@mail.de (Christian Stoller) Am 15-Feb-2024 03:30:44 +0100 schrieb pollita@php.net:=0A> Good afternoo= n folks, I'd like to open discussion on adding OOP APIs to the cURL exte= nsion.=0A> https://wiki.php.net/rfc/curl-oop=0A> =0A> This has been a lo= ng standing bug-bear of mine, and I think its time has come.=0A> =0A> tr= y {=0A> =C2=A0 (new \CurlHandle)->setOpt(YOUR_VOTE, true)->exec();=0A> }= catch (\CurlHandleException $ex) {=0A> =C2=A0 assert(false); // Why not= ?!=0A> }=0A> =0A> -Sara=0A=0AHi Sara,=0A=0AI like your proposal generall= y. But I'd suggest to rethink the names of the methods. I understand tha= t you want to reuse the same names of the procedural version and the und= erlying lib. But this is the chance to optimize the naming and reduce in= consistence. In the future this will become harder.=0A=0AFor example the= re is the getter "getInfo" and some getters without the "get" prefix, li= ke "errno", "error" and "strerror". I'd suggest to unify them. Either us= e the "get" prefix for all of those or for none. Personally, I have no p= articular preference for one of the two options.=0A=0AThe second thing I= propose to change is the usage of abbreviations. I'd suggest the follow= ing mapping for methods of CurlHandle:=0A- errno =3D> errorNumber or get= ErrorNumber=0A- error =3D> errorMessage or getErrorMessage=0A- strerror= =3D> errorMessageByNumber or getErrorMessageByNumber=0A- exec =3D> exec= ute=0A- setOpt =3D> setOption=0A- setOptArray =3D> setOptionArray=0A=0AT= here may be better proposals from others.=0A=0AWhat do you think?=0A=0AB= est regards,=0AChristian