# Adding pecl/http to core

- Thread: https://externals.io/message/40604
- Original archive: https://news-web.php.net/php.internals/40604
- Started by Michael Wallner on 2008-09-22T18:17:58+00:00
- Messages: 27
- Page 1 of 2: messages 1 to 25 (25 per page, add `?page=N` to the URL)
- Next page: https://externals.io/message/40604.md?page=2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #40604 — Michael Wallner — 2008-09-22T18:17:58+00:00

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

Hi,

I wonder what the general opinion is on adding pecl/http to the main PHP
distribution?  Many people have poked me in the past, so I guessed it's
time to ask me and you that question once for all.

Regards,
Mike

---

## #40605 — crrodriguez@suse.de — 2008-09-22T18:46:59+00:00

URL: https://externals.io/message/40604#40605 · In reply to: #40604

Michael Wallner escribió:
> Hi,
> 
> I wonder what the general opinion is on adding pecl/http to the main PHP
> distribution?  Many people have poked me in the past, so I guessed it's
> time to ask me and you that question once for all.

+1000, :) probably the most useful addition in years.



-- 
"A computer is like an Old Testament god, with a lot of rules and no
mercy. "

Cristian Rodríguez R.
Platform/OpenSUSE - Core Services
SUSE LINUX Products GmbH
Research & Development
http://www.opensuse.org/

---

## #40611 — Ralph Schindler — 2008-09-23T03:32:38+00:00

URL: https://externals.io/message/40604#40611 · In reply to: #40605

I have to agree here.  Is the book already closed on core extensions in 5.3?

-ralph

Cristian Rodríguez wrote:
> Michael Wallner escribió:
> > […]
> 
> +1000, :) probably the most useful addition in years.

---

## #40612 — Kalle Sommer Nielsen — 2008-09-23T03:35:43+00:00

URL: https://externals.io/message/40604#40612 · In reply to: #40604

Hi

2008/9/22 Michael Wallner <mike@php.net>:
> Hi,
>
> I wonder what the general opinion is on adding pecl/http to the main PHP
> distribution?  Many people have poked me in the past, so I guessed it's
> time to ask me and you that question once for all.
>
> Regards,
> Mike
>
> --
> 
> 
>
>

Big +1 from me aswell, and its already well documented which makes it
even greater :)



-- 
Kalle Sommer Nielsen

---

## #40621 — Karsten Dambekalns — 2008-09-23T08:12:50+00:00

URL: https://externals.io/message/40604#40621 · In reply to: #40604

Hi.

Michael Wallner wrote:
> I wonder what the general opinion is on adding pecl/http to the main PHP
> distribution?  Many people have poked me in the past, so I guessed it's
> time to ask me and you that question once for all.

Not that I have a lot to say here, but +∞ from my side as well.

Karsten

---

## #40632 — Lars Strojny — 2008-09-23T12:02:47+00:00

URL: https://externals.io/message/40604#40632 · In reply to: #40604

Hi Michael,

Am Montag, den 22.09.2008, 20:17 +0200 schrieb Michael Wallner:
[...]
> I wonder what the general opinion is on adding pecl/http to the main PHP
> distribution?  Many people have poked me in the past, so I guessed it's
> time to ask me and you that question once for all.

I would like to see pecl_http in just not in 5.3. I think we are too far
in the release process to do the required work to add it. And API review
would be required (I didn't looked at it closely but is), general code
review and so on. Of course I do not speak for our release managers, but
I would say "yes, but".

cu, Lars
-- 
   Jabber: lars@strojny.net
   Weblog: http://usrportage.de

---

## #40633 — Hannes Magnusson — 2008-09-23T12:49:39+00:00

URL: https://externals.io/message/40604#40633 · In reply to: #40604

> Hi,
>
> I wonder what the general opinion is on adding pecl/http to the main PHP
> distribution?

+1

-Hannes

---

## #40634 — Lukas Kahwe Smith — 2008-09-23T12:54:50+00:00

URL: https://externals.io/message/40604#40634 · In reply to: #40632

> Hi Michael,
>
> Am Montag, den 22.09.2008, 20:17 +0200 schrieb Michael Wallner:
> [...]
> > […]
>
> I would like to see pecl_http in just not in 5.3. I think we are too  
> far
> in the release process to do the required work to add it. And API  
> review
> would be required (I didn't looked at it closely but is), general code
> review and so on. Of course I do not speak for our release managers,  
> but
> I would say "yes, but".

I have not talked to Johannes about this, but unless there is a major  
major major outcry from the internals folks to add it, its too late  
for 5.3.

That being said, there is some overlap in features with existing  
functionality. Maybe if we schedule this for PHP 6, then we might want  
to mark a few things as deprecated in PHP 5.3.

regards,
Lukas Kahwe Smith
mls@pooteeweet.org

---

## #40635 — Hannes Magnusson — 2008-09-23T13:04:16+00:00

URL: https://externals.io/message/40604#40635 · In reply to: #40634

> That being said, there is some overlap in features with existing
> functionality. Maybe if we schedule this for PHP 6, then we might want to
> mark a few things as deprecated in PHP 5.3.

Doesn't sound like a good idea.
To be of "any use" pecl/http needs curl, I don't think "built-in"
functions which do not require external things should be deprecated...

-Hannes

---

## #40655 — Marcus Boerger — 2008-09-24T03:09:51+00:00

URL: https://externals.io/message/40604#40655 · In reply to: #40635

Hello Hannes,

Tuesday, September 23, 2008, 3:04:16 PM, you wrote:

> 
> > […]

> Doesn't sound like a good idea.
> To be of "any use" pecl/http needs curl, I don't think "built-in"
> functions which do not require external things should be deprecated...

Exactly. Still we want http for its superior functionality.

And are we really that far with release? I had to interrupt the release
party but as far as I know, the number one addition still isn't finalized
yet. Even if no one cmplains about it anymore we still need some time for
adjustments.

Best regards,
 Marcus

---

## #40656 — Marcus Boerger — 2008-09-24T03:09:53+00:00

URL: https://externals.io/message/40604#40656 · In reply to: #40604

Hello Michael,

  I think it is pretty useful.

marcus

Monday, September 22, 2008, 8:17:58 PM, you wrote:

> Hi,

> I wonder what the general opinion is on adding pecl/http to the main PHP
> distribution?  Many people have poked me in the past, so I guessed it's
> time to ask me and you that question once for all.

> Regards,
> Mike




Best regards,
 Marcus

---

## #40671 — Greg Beaver — 2008-09-24T23:00:29+00:00

URL: https://externals.io/message/40604#40671 · In reply to: #40604

Michael Wallner wrote:
> Hi,
> 
> I wonder what the general opinion is on adding pecl/http to the main PHP
> distribution?  Many people have poked me in the past, so I guessed it's
> time to ask me and you that question once for all.

+1

Greg

---

## #40673 — Nathan Nobbe — 2008-09-24T23:32:37+00:00

URL: https://externals.io/message/40604#40673 · In reply to: #40671

> Michael Wallner wrote:
> > […]
>
> +1


+1

no to insult, but i find the curl api a bit painful.  the http extension is
a lot more api friendly for us oo folks out there.

-nathan

---

## #40674 — Mike R — 2008-09-25T01:09:26+00:00

URL: https://externals.io/message/40604#40674 · In reply to: #40673

Nathan Nobbe wrote:
> > […]
> 
> 
> +1

FWIW, ditto.

> no to insult, but i find the curl api a bit painful.  the http extension is
> a lot more api friendly for us oo folks out there.

Troll.

:)

Best Regards,

Mike Robinson

---

## #40677 — Jani Taskinen — 2008-09-25T06:24:44+00:00

URL: https://externals.io/message/40604#40677 · In reply to: #40674

Mike R wrote:
> Nathan Nobbe wrote:
> > […]
> 
> FWIW, ditto.
> 
> > […]

So pecl/http is actually ext/curl with OO API?
Why not merge the two then..? Or rather, replace ext/curl with pecl/http 
once latter has BC API for us non-oo folks out there..

--Jani

---

## #40679 — Nathan Nobbe — 2008-09-25T06:39:06+00:00

URL: https://externals.io/message/40604#40679 · In reply to: #40677

On Thu, Sep 25, 2008 at 12:24 AM, Jani Taskinen <jani.taskinen@sci.fi>wrote:

> Mike R wrote:
>
> > […]
> So pecl/http is actually ext/curl with OO API?


for the most part, yes (i know it requires libcurl to build), but it has a
set of functions in the global scope as well, like http_put() and
http_post().

Why not merge the two then..? Or rather, replace ext/curl with pecl/http
> once latter has BC API for us non-oo folks out there..


im not sure the global function set in pecl/http interact w/ each other as
do those in ext/curl.  the two sets of functions may be mutually exclusive,
but i suspect there could be some BC breakage in a merge of the two
extensions.

-nathan

---

## #40702 — Michael Wallner — 2008-09-26T10:04:15+00:00

URL: https://externals.io/message/40604#40702 · In reply to: #40677

Jani Taskinen wrote:

> So pecl/http is actually ext/curl with OO API?

Not really. libcurl is not HTTP only, pecl/http utilizes libcurl for
it's HTTP request functionality. pecl/http also provides much improved
HTTP response and zlib functionality besides an "swizz-army-knife" for URLs.

> Why not merge the two then..? Or rather, replace ext/curl with pecl/http
> once latter has BC API for us non-oo folks out there..

You don't have to write OO code to use pecl/http, neither do you
have the possibility to query any protocol other than HTTP with 
pecl/http.

Regards,
Mike

---

## #40787 — Ralph Schindler — 2008-09-29T17:10:37+00:00

URL: https://externals.io/message/40604#40787 · In reply to: #40702

Mike,

I have a few questions about the API and target use cases.  What is the 
best medium to ask these questions and document them?  This thread 
certainly is not the best place im sure of.

Thanks,
Ralph

Michael Wallner wrote:
> Jani Taskinen wrote:
> 
> > […]
> 
> Not really. libcurl is not HTTP only, pecl/http utilizes libcurl for
> it's HTTP request functionality. pecl/http also provides much improved
> HTTP response and zlib functionality besides an "swizz-army-knife" for URLs.
> 
> > […]
> 
> You don't have to write OO code to use pecl/http, neither do you
> have the possibility to query any protocol other than HTTP with 
> pecl/http.
> 
> Regards,
> Mike

---

## #40805 — Michael Wallner — 2008-09-30T07:21:51+00:00

URL: https://externals.io/message/40604#40805 · In reply to: #40787

Ralph Schindler wrote:
> Mike,
> 
> I have a few questions about the API and target use cases.  What is the
> best medium to ask these questions and document them?  This thread
> certainly is not the best place im sure of.

I'm moving this to php.pecl.dev then.  That should be the right place.

Regards,
Mike

---

## #41438 — Hannes Magnusson — 2008-10-27T11:37:55+00:00

URL: https://externals.io/message/40604#41438 · In reply to: #40634

>
> I have not talked to Johannes about this, but unless there is a major major
> major outcry from the internals folks to add it, its too late for 5.3.

I count one "vote" against it...

-Hannes

---

## #41461 — Ralph Schindler — 2008-10-27T15:15:26+00:00

URL: https://externals.io/message/40604#41461 · In reply to: #41438

While overall solid, I have 1 api critique that may or may not influence 
inclusion..

The naming's seem slightly awkward for HttpResponse.  Seemingly, 
HttpResponse is the compliment to HttpRequest given their namings.  But 
looking at the api (the fact that its all static methods), it leads me 
to believe that this class is more closely tied to the CURRENT PHP 
response buffer.  Is this the case?

While looking at the API for HttpRequest, it appears that after a 
request is sent, it retrives an HTTPMessage object back (which would 
make that class the compliment in the Request/Response paradigm).

If so, perhaps an alternate API and naming could be suggested? 
HttpCurrentResponse makes alot of sense to me (as to not imply itself as 
HttpRequest's compliment).. Also, would it make any sense (in this 
case), to change the API to non-static methods, and object instantiation 
to a getInstance() singleton pattern?  This would allow for the class to 
be extended and decorated and would be given more of an "object" feel- 
which i feel like this the real value added here.

Please correct me if I am wrong,

Thanks,
Ralph

Hannes Magnusson wrote:
> 
> > […]
> 
> I count one "vote" against it...
> 
> -Hannes

---

## #41480 — johannes@php.net — 2008-10-27T18:59:00+00:00

URL: https://externals.io/message/40604#41480 · In reply to: #40604

> I wonder what the general opinion is on adding pecl/http to the main PHP
> distribution?  Many people have poked me in the past, so I guessed it's
> time to ask me and you that question once for all.

I didn't took a deeper look at it yet, just some doc reading. One thing
I found was that it's using tons of ini settings. Having ini setting
means that an admin might break apps without really knowing.

I think it's fine to have settings for limitations on pconnects, but
stuff like http.request.methods.allowed or http.only_exceptions should
imo be set as object properties (or similar), not globally using ini
settings.

johannes

---

## #41494 — crrodriguez@suse.de — 2008-10-28T01:00:37+00:00

URL: https://externals.io/message/40604#41494 · In reply to: #41480

Johannes Schlüter escribió:
>or http.only_exceptions should
> imo be set as object properties (or similar), not globally using ini
> settings.

Or just throw only exceptions and no ini setting at all.



-- 
"A computer is like an Old Testament god, with a lot of rules and no
mercy. "

Cristian Rodríguez R.
Platform/OpenSUSE - Core Services
SUSE LINUX Products GmbH
Research & Development
http://www.opensuse.org/

---

## #41504 — Lars Strojny — 2008-10-28T11:47:39+00:00

URL: https://externals.io/message/40604#41504 · In reply to: #41480

Hi Johannes,

Am Montag, den 27.10.2008, 19:59 +0100 schrieb Johannes Schlüter:
[...]
> I think it's fine to have settings for limitations on pconnects, but
> stuff like http.request.methods.allowed or http.only_exceptions should
> imo be set as object properties (or similar), not globally using ini
> settings.

I totally agree, reasons like that and others like Class::singleton()
instead of getInstance() (which seems more common in the PHP world) is
the reason I would like to do a proper API review, before promoting it
to core.

cu, Lars

---

## #41505 — Stan Vassilev | FM — 2008-10-28T12:33:25+00:00

URL: https://externals.io/message/40604#41505 · In reply to: #41504

I've not seen plenty of "Class::singleton()" myself, getInstance is an 
accepted standard in all languages, including the PHP code I wrote, and I've 
had experience with.

Regards, Stan Vassilev

---

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