# [RFC] [VOTE] pecl_http

- Thread: https://externals.io/message/81306
- Original archive: https://news-web.php.net/php.internals/81306
- Started by Michael Wallner on 2015-01-28T12:17:50+00:00
- Messages: 52
- RFC: pecl_http (Declined) — https://externals.io/rfc/pecl_http.md
- Page 1 of 3: messages 1 to 25 (25 per page, add `?page=N` to the URL)
- Next page: https://externals.io/message/81306.md?page=2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #81306 — Michael Wallner — 2015-01-28T12:17:50+00:00

URL: https://externals.io/message/81306#81306

Hi,

Discussion has been very low on this topic since it was proposed on
August 19th, so I just opened the vote on the RFC whether to add
pecl_http to the core. The vote will be open until about 12:00 UTC on
Friday, February 6th.

https://wiki.php.net/rfc/pecl_http#vote


-- 
Regards,
Mike

---

## #81316 — Levi Morrison — 2015-01-28T17:53:06+00:00

URL: https://externals.io/message/81306#81316 · In reply to: #81306

>
> Discussion has been very low on this topic since it was proposed on
> August 19th, so I just opened the vote on the RFC whether to add
> pecl_http to the core. The vote will be open until about 12:00 UTC on
> Friday, February 6th.
>
> https://wiki.php.net/rfc/pecl_http#vote


I wish you had pinged the list before opening the vote. I know there were a
few people who wanted to make comments but have just been very busy. For
example, I have been dealing with the return types RFC which has soaked up
all of the time I have for working on PHP projects.

Some feedback: I feel the RFC is not clear about the advantages and
disadvantages of including this package. Mostly, the RFC is "hey I have
this package can we include it in core?" I feel like it's fairly incomplete
as to *why* we should include it. There is a fair amount of work done in
user-land for these types of utilities, and I think without a more balanced
discussion we'd be giving this extension a distinct advantage.

If we allow it to remain in voting phase despite these issues, I have to
vote no simply because I don't feel like there is enough information
presented in the RFC for anyone except current pecl_http users to make a
good decision; that's hardly a good situation for the language as a whole.

---

## #81317 — Levi Morrison — 2015-01-28T17:58:10+00:00

URL: https://externals.io/message/81306#81317 · In reply to: #81316

> Discussion has been very low on this topic since it was proposed on
> > […]
>
>
> I wish you had pinged the list before opening the vote. I know there were
> a few people who wanted to make comments but have just been very busy. For
> example, I have been dealing with the return types RFC which has soaked up
> all of the time I have for working on PHP projects.
>
> Some feedback: I feel the RFC is not clear about the advantages and
> disadvantages of including this package. Mostly, the RFC is "hey I have
> this package can we include it in core?" I feel like it's fairly incomplete
> as to *why* we should include it. There is a fair amount of work done in
> user-land for these types of utilities, and I think without a more balanced
> discussion we'd be giving this extension a distinct advantage.
>
> If we allow it to remain in voting phase despite these issues, I have to
> vote no simply because I don't feel like there is enough information
> presented in the RFC for anyone except current pecl_http users to make a
> good decision; that's hardly a good situation for the language as a whole.
>
>
Oh, one more item: has anyone had time to review the pieces and how they
all interact, as well as reviewing the quality of each component? I should
hardly think in the time given this has been done. I'm not saying this
extension is bad; I am saying that I don't think there's been time for
anyone to properly evaluate whether it is or not.

---

## #81318 — Andrea Faulds — 2015-01-28T17:58:25+00:00

URL: https://externals.io/message/81306#81318 · In reply to: #81316

Hi Levi,

> 
> 
> > […]
> 
> 
> I wish you had pinged the list before opening the vote. I know there were a
> few people who wanted to make comments but have just been very busy. For
> example, I have been dealing with the return types RFC which has soaked up
> all of the time I have for working on PHP projects.
> 
> Some feedback: I feel the RFC is not clear about the advantages and
> disadvantages of including this package. Mostly, the RFC is "hey I have
> this package can we include it in core?" I feel like it's fairly incomplete
> as to *why* we should include it. There is a fair amount of work done in
> user-land for these types of utilities, and I think without a more balanced
> discussion we'd be giving this extension a distinct advantage.
> 
> If we allow it to remain in voting phase despite these issues, I have to
> vote no simply because I don't feel like there is enough information
> presented in the RFC for anyone except current pecl_http users to make a
> good decision; that's hardly a good situation for the language as a whole.

I completely agree here: reading the RFC I have little idea as to:

* What pecl/http actually is
* What pecl/http does
* How what pecl/http does differs from PHP’s existing facilities
* Why PHP should include pecl/http
* Why PHP should enable pecl/http by default

As it stands, I can’t see how it’s substantially different from our existing stuff in core, except maybe more OOP and a little more feature-complete. I’ve sort of gleaned this from looking at pecl/http’s docs… the RFC is barren, lacking in details about anything.

It really doesn’t make any case for itself, and I’m also concerned about possibly unnecessary implementation duplication. PHP already has several implementations of various aspects of the HTTP protocol, the RFC doesn’t explain why we need another.

So, like you, I’m probably going to vote No.

Thanks.

--
Andrea Faulds
http://ajf.me/

---

## #81320 — Andrea Faulds — 2015-01-28T18:03:34+00:00

URL: https://externals.io/message/81306#81320 · In reply to: #81317

Hi Levi,

> 
> 
> Oh, one more item: has anyone had time to review the pieces and how they
> all interact, as well as reviewing the quality of each component? I should
> hardly think in the time given this has been done. I'm not saying this
> extension is bad; I am saying that I don't think there's been time for
> anyone to properly evaluate whether it is or not.

Related to that: I should have asked about the size. By the looks of things pecl/http is a pretty big extension that covers an awful lot of functionality. The RFC’s lack of rationale for adding the extension is bad enough, but the size of the extension makes it worse. It’s a lot of classes (28 in total), so I think the RFC really needs a strong case to add all these different modules. Not only does the RFC need an overall rationale, but each module probably needs its own rationale: how does it compare to PHP’s existing functions for that feature, etc.?

Thanks.

--
Andrea Faulds
http://ajf.me/

---

## #81321 — Nikita Popov — 2015-01-28T18:08:44+00:00

URL: https://externals.io/message/81306#81321 · In reply to: #81306

> Hi,
>
> Discussion has been very low on this topic since it was proposed on
> August 19th, so I just opened the vote on the RFC whether to add
> pecl_http to the core. The vote will be open until about 12:00 UTC on
> Friday, February 6th.
>
> https://wiki.php.net/rfc/pecl_http#vote
>

I don't feel like this RFC leaves me in a position to make a qualified
choice as to whether this extension should be included or not. There's just
way too little information in here, and I don't think an extension like
this should be added lightly.

I understand that it may not be feasible to include full API design
documents in an RFC, but there's a lot of other things that just aren't
clear to me. A few random points:

 * While the RFC does not mention it, I understand that pecl_http has hard
dependencies on two other extensions. What do these extensions do and how
is the integration in core supposed to be handled?
 * The RFC mentioned that "pecl_http adds processing for json request
bodies into $_POST". Could you elaborate on this, in particular when this
is enabled and how automatic it is? Did you give proper consideration to
the security implications that this has? E.g. are you confident that the
implementation is HashDOS resistant?
 * A number of libraries and frameworks already provide functionality that
intersects with parts of the pecl_http extension. There's also the upcoming
PSR-7 standard that might be of relevance. How does the API exposed by
pecl_http compare to these / follow existing APIs / standards?
 * How does this extension relate to curl, in particular how is the
dependency situation and what happens when the dependency is not met? What
other optional dependencies are there?
 * Why do we need to include these kinds of APIs directly into PHP instead
of the current situations where object oriented HTTP APIs are implemented
by libraries / frameworks and can evolve independently of PHP?

Generally I am not entirely convinced that we should be including any
"high-level" APIs in this direction. With the advent of Composer it is
trivial to include an HTTP library written in PHP. I'm generally not a fan
of including functionality in core if there is no strong reason why it
can't or shouldn't be implemented as a userland library. Including
something in core usually freezes it for all time and makes future
improvements very hard.

What I would be primarily interested in here is the addition of "low-level"
APIs for handling HTTP - in particular functions for parsing raw strings.
This is a performance sensitive part that can benefit from a C based
implementation. (While high-level APIs benefit less from C - or even
anti-benefit by being buggier and harder to adjust.)

TL;DR I need more info to make an informed choice.

Nikita

---

## #81322 — Michael Wallner — 2015-01-28T18:12:19+00:00

URL: https://externals.io/message/81306#81322 · In reply to: #81317

> On Wed, Jan 28, 2015 at 10:53 AM, Levi Morrison <levim@php.net
> <mailto:levim@php.net>> wrote:
> 
>         Discussion has been very low on this topic since it was proposed on
>         August 19th, so I just opened the vote on the RFC whether to add
>         pecl_http to the core. The vote will be open until about 12:00
>         UTC on
>         Friday, February 6th.
> 
>         https://wiki.php.net/rfc/pecl_http#vote
> 
> 
>     I wish you had pinged the list before opening the vote. I know there
>     were a few people who wanted to make comments but have just been
>     very busy. For example, I have been dealing with the return types
>     RFC which has soaked up all of the time I have for working on PHP
>     projects. 
> 
>     Some feedback: I feel the RFC is not clear about the advantages and
>     disadvantages of including this package. Mostly, the RFC is "hey I
>     have this package can we include it in core?" I feel like it's
>     fairly incomplete as to *why* we should include it. There is a fair
>     amount of work done in user-land for these types of utilities, and I
>     think without a more balanced discussion we'd be giving this
>     extension a distinct advantage.
> 
>     If we allow it to remain in voting phase despite these issues, I
>     have to vote no simply because I don't feel like there is enough
>     information presented in the RFC for anyone except current pecl_http
>     users to make a good decision; that's hardly a good situation for
>     the language as a whole.
> 
> 
> Oh, one more item: has anyone had time to review the pieces and how they
> all interact, as well as reviewing the quality of each component? I
> should hardly think in the time given this has been done. I'm not saying
> this extension is bad; I am saying that I don't think there's been time
> for anyone to properly evaluate whether it is or not.

Well, there's been hardly any activity on the RFC for over five months,
if one didn't have the chance for review in this time frame then the
topic is probably not interesting enough for her.

But I already guessed, that there wouldn't be a real discussion until I
slapped the label VOTE on this RFC.

-- 
Regards,
Mike

---

## #81323 — Michael Wallner — 2015-01-28T18:43:53+00:00

URL: https://externals.io/message/81306#81323 · In reply to: #81321

> On Wed, Jan 28, 2015 at 1:17 PM, Michael Wallner <mike@php.net
> <mailto:mike@php.net>> wrote:
> 
>     Hi,
> 
>     Discussion has been very low on this topic since it was proposed on
>     August 19th, so I just opened the vote on the RFC whether to add
>     pecl_http to the core. The vote will be open until about 12:00 UTC on
>     Friday, February 6th.
> 
>     https://wiki.php.net/rfc/pecl_http#vote
> 
> 
> I don't feel like this RFC leaves me in a position to make a qualified
> choice as to whether this extension should be included or not. There's
> just way too little information in here, and I don't think an extension
> like this should be added lightly.
> 
> I understand that it may not be feasible to include full API design
> documents in an RFC, but there's a lot of other things that just aren't
> clear to me. A few random points:
> 
>  * While the RFC does not mention it, I understand that pecl_http has
> hard dependencies on two other extensions. What do these extensions do
> and how is the integration in core supposed to be handled?

As stated in one of the discussion threads, those dependencies could be
merged to main/ and/or ext/standard. In the current patch the persistent
handle API is in main and the property proxy API is in ext/standard.

The resource factory and persistent handle API provides a similar but
extended set of functionality of what zend_list provides.

ZE2 compatible docs can currently be found here:
http://php.github.io/pecl-php-raphf/php__raphf_8h.html

The property proxy handles R/W access to object properties that
represent C struct members. Similar functionality was supposed to be in
ZE2, but disfunctional to my findings.

ZE2 compatible docs can currently be found here:
http://php.github.io/pecl-php-propro/php__propro_8h.html

>  * The RFC mentioned that "pecl_http adds processing for json request
> bodies into $_POST". Could you elaborate on this, in particular when
> this is enabled and how automatic it is? Did you give proper
> consideration to the security implications that this has? E.g. are you
> confident that the implementation is HashDOS resistant?

Not necessarily. It suffers from the same issues, if any, like
php_json_decode().

>  * A number of libraries and frameworks already provide functionality
> that intersects with parts of the pecl_http extension. There's also the
> upcoming PSR-7 standard that might be of relevance. How does the API
> exposed by pecl_http compare to these / follow existing APIs / standards?

The first release of pecl_http was exactly ten years ago and it has
evolved a lot, of course. So I'm not sure what it should have followed.

>  * How does this extension relate to curl, in particular how is the
> dependency situation and what happens when the dependency is not met?

libcurl is the only client provider currently, so if libcurl is not
available at build time, the client functionality is unavailable at
runtime (i.e. http\Client is not instantiatable).

> What other optional dependencies are there?

Optional build time dependecies are json, iconv and hash.
All of them not of major importance.

json: decoding application/json entities
iconv: translating query strings
hash: generating ETags for dynamic entities

>  * Why do we need to include these kinds of APIs directly into PHP
> instead of the current situations where object oriented HTTP APIs are
> implemented by libraries / frameworks and can evolve independently of PHP?

We don't need to. Including it in core was a topic every other year, but
I never felt it was ready before.

> Generally I am not entirely convinced that we should be including any
> "high-level" APIs in this direction. With the advent of Composer it is
> trivial to include an HTTP library written in PHP. I'm generally not a
> fan of including functionality in core if there is no strong reason why
> it can't or shouldn't be implemented as a userland library. Including
> something in core usually freezes it for all time and makes future
> improvements very hard.
> 
> What I would be primarily interested in here is the addition of
> "low-level" APIs for handling HTTP - in particular functions for parsing
> raw strings. This is a performance sensitive part that can benefit from
> a C based implementation. (While high-level APIs benefit less from C -
> or even anti-benefit by being buggier and harder to adjust.)
> 
> TL;DR I need more info to make an informed choice.

I really had a problem to imagine what people would have liked to read
in the RFC; all I could think of had a touch of cheesy commercials, so I
refrained from it and waited for a discussion to spoil, which obviously
never happened.


-- 
Regards,
Mike

---

## #81324 — Matteo Beccati — 2015-01-28T19:07:54+00:00

URL: https://externals.io/message/81306#81324 · In reply to: #81306

> Discussion has been very low on this topic since it was proposed on
> August 19th, so I just opened the vote on the RFC whether to add
> pecl_http to the core. The vote will be open until about 12:00 UTC on
> Friday, February 6th.
>
> https://wiki.php.net/rfc/pecl_http#vote

Disclaimer: I'm not going to discuss the merits of the extension itself. 
I've never used it but I'm sure it's perfectly doing its job.

As Nikita mentions, PSR-7 is under way and currently gaining some 
traction. At the moment the PSR-7 interfaces are designed to be 
immutable, although I that's still open for debate. If the RFC passes, 
we'd be taking a fairly strong position and pushing the current 
pecl_http implementation as a de-facto standard. Sure, PHP-FIG would 
still be free to come up with their own standard, but it just doesn't 
seem much fair to me.

Also, we're planning to move extensions from core to pecl, for example 
ext/mysql which I is still widely used by many applications, despite its 
known shortcomings. TBH, I don't see many reasons why a pecl extension 
should be moved to core.

That's basically why I voted no earlier today.


Cheers
-- 
Matteo Beccati

Development & Consulting - http://www.beccati.com/

---

## #81325 — Michael Wallner — 2015-01-28T19:13:05+00:00

URL: https://externals.io/message/81306#81325 · In reply to: #81320

> Hi Levi,
> 
> > […]
> 
> Related to that: I should have asked about the size. By the looks of
> things pecl/http is a pretty big extension that covers an awful lot
> of functionality. The RFC’s lack of rationale for adding the
> extension is bad enough, but the size of the extension makes it
> worse. It’s a lot of classes (28 in total), so I think the RFC really
> needs a strong case to add all these different modules. Not only does
> the RFC need an overall rationale, but each module probably needs its
> own rationale: how does it compare to PHP’s existing functions for
> that feature, etc.?

Yes, it's huge, but mostly only because PHP, the web language, lacks in
all of those areas. A quick overview of the top namespace:

- Client

The http stream wrapper is a hack and the existing libcurl binding is
subpar. They could be improved separately, but that is not subject of
this RFC.

Currently only libcurl is implemented as a provider for the client
functionality. Provides most of the functionality of current libcurl.
Representation of the request and response how a client sees them.
Support for parallel requests and optional libev{,ent} support.

- Cookie

Parses Cookie and Set-Cookie header values. Actually builds on http\Params.

- Encoding

Streamable implementations of chunked, zlib/gzip/deflate encodings.

- Env

Negotiation facilities, representations of the request and response how
the server sees them. Support for range requests and caching by
etag/last-modified.

- Header

Header parser and tools.

- Message

Message parser and tools. Also message bodies with support for building
and parsing multipart bodies.

- Params

Header params parser; think of a content-type or an accept header.

- QueryString

Query string parser and tools. Actually builds on http\Params.

- Url

URL parser and tools (actually discovered today, that it leans towards IRIs)



-- 
Regards,
Mike

---

## #81326 — Andrea Faulds — 2015-01-28T19:18:40+00:00

URL: https://externals.io/message/81306#81326 · In reply to: #81325

Hi Michael,

> 
> 
> - Client
> 
> The http stream wrapper is a hack and the existing libcurl binding is
> subpar. They could be improved separately, but that is not subject of
> this RFC.
> 
> Currently only libcurl is implemented as a provider for the client
> functionality. Provides most of the functionality of current libcurl.
> Representation of the request and response how a client sees them.
> Support for parallel requests and optional libev{,ent} support.

If the client is merely a wrapper around cURL, what benefit does it offer over ext/curl except a better API?

Personally, I’ve never liked that PHP requires cURL for doing HTTP requests. It’s a language made for the web, it should have built-in HTTP, and it should share code between its server-side HTTP and client-side HTTP stuff. I don’t think that the HTTP stream wrappers are a “hack” - they’re what PHP should have had all along. I think we should focus on improving them (so there’s no need to use cURL) rather than adding yet another HTTP client.

Thanks.
--
Andrea Faulds
http://ajf.me/

---

## #81327 — Michael Wallner — 2015-01-28T19:19:25+00:00

URL: https://externals.io/message/81306#81327 · In reply to: #81324

> 
> > […]
> 
> Disclaimer: I'm not going to discuss the merits of the extension itself.
> I've never used it but I'm sure it's perfectly doing its job.
> 
> As Nikita mentions, PSR-7 is under way and currently gaining some
> traction. At the moment the PSR-7 interfaces are designed to be
> immutable, although I that's still open for debate. If the RFC passes,
> we'd be taking a fairly strong position and pushing the current
> pecl_http implementation as a de-facto standard. Sure, PHP-FIG would
> still be free to come up with their own standard, but it just doesn't
> seem much fair to me.

Why is everybody so obssessed by the word "standard"?
What is "fair" supposed to mean in this regard?

Doesn't FIG stand for Framework Interoperability Group? I've been there
and wanted to start a discussion on the topic, but without success.


> Also, we're planning to move extensions from core to pecl, for example
> ext/mysql which I is still widely used by many applications, despite its
> known shortcomings. TBH, I don't see many reasons why a pecl extension
> should be moved to core.

So that basically means, there shouldn't be any extension added to the
core any more, or only PECL ones?

> That's basically why I voted no earlier today.

Okay.

-- 
Regards,
Mike

---

## #81328 — Michael Wallner — 2015-01-28T19:48:57+00:00

URL: https://externals.io/message/81306#81328 · In reply to: #81326

> Hi Michael,
> 
> > […]
> 
> If the client is merely a wrapper around cURL, what benefit does it
> offer over ext/curl except a better API?
> 
> Personally, I’ve never liked that PHP requires cURL for doing HTTP
> requests. It’s a language made for the web, it should have built-in
> HTTP, and it should share code between its server-side HTTP and
> client-side HTTP stuff. I don’t think that the HTTP stream wrappers
> are a “hack” - they’re what PHP should have had all along. I think we
> should focus on improving them (so there’s no need to use cURL)
> rather than adding yet another HTTP client.

Sounds a bit like NIH.
We could implement a http_client driver with the code from the stream
wrapper and see how they compare in feature set and performance.

-- 
Regards,
Mike

---

## #81329 — Lester Caine — 2015-01-28T19:57:58+00:00

URL: https://externals.io/message/81306#81329 · In reply to: #81327

> > […]

> So that basically means, there shouldn't be any extension added to the
> core any more, or only PECL ones?

Bundling more and more into core is a pointless exercise. If pecl_http
is any good then it will gain it's own traction in distribution space as
just another package that can be added. Unbundling and better management
of interoperability is starting to see some more support and management
of extensions in their own code space is going to make life a lot easier
in the long term!

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

---

## #81331 — Levi Morrison — 2015-01-28T20:03:53+00:00

URL: https://externals.io/message/81306#81331 · In reply to: #81322

> 
> > […]
> on
> > […]
>
> Well, there's been hardly any activity on the RFC for over five months,
> if one didn't have the chance for review in this time frame then the
> topic is probably not interesting enough for her.
>
> But I already guessed, that there wouldn't be a real discussion until I
> slapped the label VOTE on this RFC.
>

I always send an email to the list before putting something to vote to
gather more feedback. It usually solicits one or two more points of
discussion. This is not technically a requirement, but if it has has no
activity for 5 months what are the chances that it is on my mind? (Hint:
exactly zero)

As an RFC author if you want people to think about your RFC and discuss it
then on occasion you need to bring it up now and again.

---

## #81332 — Michael Wallner — 2015-01-28T20:06:46+00:00

URL: https://externals.io/message/81306#81332 · In reply to: #81331

> On Wed, Jan 28, 2015 at 11:12 AM, Michael Wallner <mike@php.net
> <mailto:mike@php.net>> wrote:
> 
>     
> > […]
>     proposed on
> > […]
>     to add
> > […]
>     there
> > […]
>     advantages and
> > […]
>     fair
> > […]
>     and I
> > […]
>     pecl_http
> > […]
>     how they
> > […]
>     saying
> > […]
>     time
> > […]
> 
>     Well, there's been hardly any activity on the RFC for over five months,
>     if one didn't have the chance for review in this time frame then the
>     topic is probably not interesting enough for her.
> 
>     But I already guessed, that there wouldn't be a real discussion until I
>     slapped the label VOTE on this RFC.
> 
> 
> I always send an email to the list before putting something to vote to
> gather more feedback. It usually solicits one or two more points of
> discussion. This is not technically a requirement, but if it has has no
> activity for 5 months what are the chances that it is on my mind? (Hint:
> exactly zero)
> 
> As an RFC author if you want people to think about your RFC and discuss
> it then on occasion you need to bring it up now and again.

Yep, I re-started discussion on January 22nd. Gathered the same
participants than the first discussion round.

-- 
Regards,
Mike

---

## #81333 — Andrea Faulds — 2015-01-28T20:20:53+00:00

URL: https://externals.io/message/81306#81333 · In reply to: #81328

Hi Michael,

> 
> 
> 
> > […]
> 
> Sounds a bit like NIH.

Ah, no, I hope I’m not misunderstood that way. My objection to cURL is that I don’t feel we should be using separate codebases for HTTP client stuff vs. HTTP server stuff. It doesn’t feel right to me that in such a web-focussed language we should have to use an external library for making HTTP requests - why can’t we use PHP’s own HTTP capabilities? IMO, they should be a single codebase. It’s needless duplication otherwise.

Thanks.

--
Andrea Faulds
http://ajf.me/

---

## #81334 — Stanislav Malyshev — 2015-01-28T20:30:17+00:00

URL: https://externals.io/message/81306#81334 · In reply to: #81326

Hi!

> Personally, I’ve never liked that PHP requires cURL for doing HTTP
> requests. It’s a language made for the web, it should have built-in

I see no problem in depending on cURL. NIH'ing every part of the
software universe in unfeasible, and if somebody does this one job and
does it well - why not use it? We don't have enough resources here to
implement every detail of the huge protocol like HTTP, and that's the
whole point of opensource to reuse and combine projects.

> HTTP, and it should share code between its server-side HTTP and
> client-side HTTP stuff. I don’t think that the HTTP stream wrappers
> are a “hack” - they’re what PHP should have had all along. I think we

HTTP stream wrappers work for some cases, but not for all and for cases
where you need deep involvement with details of HTTP - like headers,
byteranges, content encodings, etc. - they might not be the best API to
deal with it.

-- 
Stas Malyshev
smalyshev@gmail.com

---

## #81335 — Stanislav Malyshev — 2015-01-28T20:32:52+00:00

URL: https://externals.io/message/81306#81335 · In reply to: #81316

Hi!

> Some feedback: I feel the RFC is not clear about the advantages and
> disadvantages of including this package. Mostly, the RFC is "hey I have
> this package can we include it in core?" I feel like it's fairly incomplete

Agreed. There needs to be some work done on explaining why we need to
include this in core, not just "ok, here's a bag of bits, do you want
it?" Maybe we do, maybe we don't - but please, help us decide that! I'd
like the RFC to clearly explain what the new extension does better and
why.

Also, I see in the docs (which will need to be converted to docbook if
it is added, btw) this:

This extension unconditionally depends on the pre-loaded presence of the
following PHP extensions:

raphf
propro
spl

SPL is fine, but what's with the other two? Are they to be merged into
core too? The RFC does not mention them and they seem to be some
unrelated things which I personally have no idea about.

In general, I'd love to have great HTTP support in core, but let's do it
right. The more time you as RFC author spend now on explaining why this
ext is great, the more tools we'll have if it's accepted to get users to
actually use it, and that's the ultimate point of it. Without it, we
don't have adequate tools to make a decision and to support the users
after the decision if it's positive.

-- 
Stas Malyshev
smalyshev@gmail.com

---

## #81336 — Andrea Faulds — 2015-01-28T20:38:23+00:00

URL: https://externals.io/message/81306#81336 · In reply to: #81334

Hi Stas,

> 
> 
> Hi!
> 
> > […]
> 
> I see no problem in depending on cURL. NIH'ing every part of the
> software universe in unfeasible, and if somebody does this one job and
> does it well - why not use it? We don't have enough resources here to
> implement every detail of the huge protocol like HTTP, and that's the
> whole point of opensource to reuse and combine projects.

I suppose cURL isn’t so bad… really, the API is the biggest issue with that. HTTP requests in PHP feel like a second-class citizen and must be done through an awkward set of PHP bindings to a C library. That’s awful for a language made for the web.

I’d be okay with cURL were it not for the API, I guess. Actually, if we’re to keep HTTP stream wrappers and keep using cURL, then the HTTP stream wrapper should probably also use cURL, right?

> > […]
> 
> HTTP stream wrappers work for some cases, but not for all and for cases
> where you need deep involvement with details of HTTP - like headers,
> byteranges, content encodings, etc. - they might not be the best API to
> deal with it.

This is true. The main thing I like about HTTP stream wrappers is that they’re part of core PHP rather than some external library. Also, they support headers, have done for ages. 

Thanks.

--
Andrea Faulds
http://ajf.me/

---

## #81337 — Matteo Beccati — 2015-01-28T20:46:21+00:00

URL: https://externals.io/message/81306#81337 · In reply to: #81327

> 
> > […]
>
> Why is everybody so obssessed by the word "standard"?
> What is "fair" supposed to mean in this regard?
 >
> Doesn't FIG stand for Framework Interoperability Group? I've been there
> and wanted to start a discussion on the topic, but without success.

Seen that too. Welcoming "BE GONE FOUL INTERNALS DEVELOPER" joke aside, 
some objections have been made. You didn't like them, you disappeared 
suggesting PHP-FIG to "play alone in your shady little shed".

Since PSR-7 is being discussed now *and* pecl_http can't implement an 
interface that still is being discussed, I would rather vote "no" now 
and maybe change my mind in future if PSR-7 becomes a thing and 
pecl_http follows. Or PSR-7 fails, for that matter.


> > […]
>
> So that basically means, there shouldn't be any extension added to the
> core any more, or only PECL ones?

pecl and (hopefully) pickle do a pretty good job at installing anything 
that's required. On the other hand distros offer packages for most of 
the core extensions anyway, even the ubiquitous zlib or json sometimes. 
So, yes I don't think core should have more extensions bundled, unless 
there's a very good reason. And I didn't see any yet.


Cheers
-- 
Matteo Beccati

Development & Consulting - http://www.beccati.com/

---

## #81338 — Stanislav Malyshev — 2015-01-28T20:48:17+00:00

URL: https://externals.io/message/81306#81338 · In reply to: #81323

Hi!

> As stated in one of the discussion threads, those dependencies could be
> merged to main/ and/or ext/standard. In the current patch the persistent

This should be prominently part of the RFC, not buried in the threads.
Merging two extensions into ext/standard is not some tiny detail that
nobody cares about, it's putting stuff into PHP core that has to be
supported and accounted for by everybody.

> The resource factory and persistent handle API provides a similar but
> extended set of functionality of what zend_list provides.

Extended in which way? Why zend_list is not enough? Why it is preferable
to use this new extension to improving zend_list?

> The property proxy handles R/W access to object properties that
> represent C struct members. Similar functionality was supposed to be in
> ZE2, but disfunctional to my findings.

Why it is "disfunctional" and which findings prove it? ZE objects has a
number of handlers, why it is not enough to use them? Which capabilities
the new extension adds that did not exist before? Why it is preferable
to add new API to the core to extending existing APIs to support needed
use-cases?

I think the fact that the RFC fails to mention that this is also vote
for introducing two new APIs into the core, which have no direct
relation to HTTP, is a pretty big defect. I understand it is not
intentional, but voting on this RFC without clear realization that the
vote is actually on three things, two of which are core API
modifications and never mentioned in the RFC itself, is just wrong and
such RFC should have never been put to vote.

I understand making these two extensions clear puts an additional burden
on the RFC author, but that is what putting things into core involves,
especially thing that is this big - once it is in the core, everybody
shares the responsibility for it, especially the main/ parts which are
not something you can dismiss as private matter for the extension.

-- 
Stas Malyshev
smalyshev@gmail.com

---

## #81339 — Michael Wallner — 2015-01-28T20:48:43+00:00

URL: https://externals.io/message/81306#81339 · In reply to: #81335

> Hi!
> 
> > […]
> 
> Agreed. There needs to be some work done on explaining why we need to
> include this in core, not just "ok, here's a bag of bits, do you want
> it?" Maybe we do, maybe we don't - but please, help us decide that! I'd
> like the RFC to clearly explain what the new extension does better and
> why.
> 
> Also, I see in the docs (which will need to be converted to docbook if
> it is added, btw) this:
> 
> This extension unconditionally depends on the pre-loaded presence of the
> following PHP extensions:
> 
> raphf
> propro
> spl
> 
> SPL is fine, but what's with the other two? Are they to be merged into
> core too? The RFC does not mention them and they seem to be some
> unrelated things which I personally have no idea about.

It was in the RFC, but they obviously vanished in the last edit...

I explained that in another mail and will put it (amongst a lot of other
things that came up during this thread) into the RFC:

---8<---
As stated in one of the discussion threads, those dependencies could be
merged to main/ and/or ext/standard. In the current patch the persistent
handle API is in main and the property proxy API is in ext/standard.

The resource factory and persistent handle API provides a similar but
extended set of functionality of what zend_list provides.

ZE2 compatible docs can currently be found here:
http://php.github.io/pecl-php-raphf/php__raphf_8h.html

The property proxy handles R/W access to object properties that
represent C struct members. Similar functionality was supposed to be in
ZE2, but disfunctional to my findings.

ZE2 compatible docs can currently be found here:
http://php.github.io/pecl-php-propro/php__propro_8h.html
--->8---

> 
> In general, I'd love to have great HTTP support in core, but let's do it
> right. The more time you as RFC author spend now on explaining why this
> ext is great, the more tools we'll have if it's accepted to get users to
> actually use it, and that's the ultimate point of it. Without it, we
> don't have adequate tools to make a decision and to support the users
> after the decision if it's positive.
> 

I'm a bad sales person, but I'll try better.


-- 
Regards,
Mike

---

## #81340 — Andrea Faulds — 2015-01-28T20:56:50+00:00

URL: https://externals.io/message/81306#81340 · In reply to: #81337

Hey everyone,

> 
> 
> Since PSR-7 is being discussed now *and* pecl_http can't implement an interface that still is being discussed, I would rather vote "no" now and maybe change my mind in future if PSR-7 becomes a thing and pecl_http follows. Or PSR-7 fails, for that matter.

Related to this: is it even possible for an internal class to rely on and formally, explicitly “implement” a userland interface? It’s all very well if PHP has a built-in implementation that follows PSR-7, but it would suck if you couldn’t pass an instance of that class to a function with a (hypothetical) psr7\HttpMessage type hint.

Userland libraries don’t have this issue: they all just require the PSR-7 interface package in their composer.json and all is well.

--
Andrea Faulds
http://ajf.me/

---

## #81341 — Stanislav Malyshev — 2015-01-28T21:00:33+00:00

URL: https://externals.io/message/81306#81341 · In reply to: #81339

Hi!

> I explained that in another mail and will put it (amongst a lot of other
> things that came up during this thread) into the RFC:

This is not enough. Saying "ZE APIs suck, so I implemented a bunch of my
own and want to merge it in core because I like them" is not enough to
make an informed decision - why ZE APIs suck? Can we fix them without
introducing a bunch of new APIs? Are new APIs good for common case
beyond this particular extension?

It is not really feasible for each extension to use it's own API to deal
with resources or objects. So if we introduce a new one, we should have
clear understanding that a) existing ones are not enough and b) new one
would serve more than narrow need of one case.

> I'm a bad sales person, but I'll try better.

The community needs to take an informed decision. For that, we need the
information. You are the one who has the information, so please share
it! It is obvious you think that what you did is good - otherwise you
wouldn't propose it, and you probably know why exactly it is good - so
please tell us so we'd know too.
-- 
Stas Malyshev
smalyshev@gmail.com

---

Next page: https://externals.io/message/81306.md?page=2
