rfc:pecl_http

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:pecl_http [2015/01/30 13:40] – Removed optional dependencies on all three extensions (json, iconv, hash), and the one INI entry related to it mikerfc:pecl_http [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== PHP RFC: Add pecl_http to core ====== ====== PHP RFC: Add pecl_http to core ======
-  * Version: 2.2 +  * Version: 2.4 
-  * Date: 2015-01-30+  * Date: 2014-08-19 
 +  * Last-Modified: 2015-02-20
   * Author: Michael Wallner, <mike@php.net>   * Author: Michael Wallner, <mike@php.net>
-  * Status: Discussion+  * Status: Declined
   * First Published at: http://wiki.php.net/rfc/pecl_http   * First Published at: http://wiki.php.net/rfc/pecl_http
  
 ===== Introduction ===== ===== Introduction =====
-It was interesting to see so many “users” that know pecl_http and so many “developers” that had no clue, so let’s start early. 
  
 ==== About ==== ==== About ====
Line 32: Line 32:
  
 === Test coverage === === Test coverage ===
-The current test suite provides a code coverage of about 90% and is subject to improvement. \\ Coverage resport of v2: http://dev.iworks.at/ext-http/lcov/http/index.html +The current test suite provides a code coverage of about 90% and is subject to improvement. \\ Coverage resport of v2: http://dev.iworks.at/ext-http/lcov/ext/http/index.html 
  
 There’s one test that currently fails for me due to porting the extension to ZE3, because of reference mismatch and a leak in zend_assign_to_variable_ref() as cause. There’s one test that currently fails for me due to porting the extension to ZE3, because of reference mismatch and a leak in zend_assign_to_variable_ref() as cause.
Line 43: Line 43:
  
 ===== The Guts ===== ===== The Guts =====
-A fully merged tree can be inspected here: \\ https://github.com/m6w6/php-src/tree/merge-http+A fully merged tree can be inspected here (based on v2.2, so slightly out of date): \\ https://github.com/m6w6/php-src/tree/merge-http 
 + 
 +An up-to-date (based on v2.3) pecl_http tree for PHP7 can be found here: \\ https://github.com/php/pecl-http-pecl_http/tree/phpng
  
 ==== Documentation ==== ==== Documentation ====
Line 346: Line 348:
 === C API === === C API ===
 Most of the features are directly accessible through pecl_http's C API. Most of the features are directly accessible through pecl_http's C API.
- 
-=== RINIT === 
-The http\Env module kicks the POST parser regardless of the request method, only the right content type of x-www-form-urlencoded or form-data must be given. 
- 
-I suspect this is a controversial feature, so I’m listing it separately: \\ https://github.com/php/pecl-http-pecl_http/blob/phpng/php_http_env.c#L16-L69 
- 
-The ''FIX-ME'' note about the leak is already irrelevant, though. 
- 
-If accepted, it would be easier to ditch this RINIT and just lift the request method limitation. 
  
 === Globals === === Globals ===
-Nothing in the global namespace, except the namespace ''http''.+Nothing in the global namespace, except the namespace ''Http''.
  
 == Client == == Client ==
Line 370: Line 363:
 All of that would actually be available by ext/curl but the existing libcurl binding is in an subpar maintenance state and suffers from its own quirks. Also, to my great surprise, there are only about five people enjoying the libcurl API, or what is available from it in PHP. All of that would actually be available by ext/curl but the existing libcurl binding is in an subpar maintenance state and suffers from its own quirks. Also, to my great surprise, there are only about five people enjoying the libcurl API, or what is available from it in PHP.
  
-Currently only libcurl is implemented as a provider for http\Client, providing most of the functionality of most-current libcurl. This should be a good bet, because libcurl is mature and ubiquitously available.This does not mean that we may not implement our own "PHP" driver for http\Client, Andrea might want to do this one day.+Currently only libcurl is implemented as a provider for http\Client, providing most of the functionality of most-current libcurl. This should be a good bet, because libcurl is mature and ubiquitously available.This does not mean that we may not implement our own "PHP" driver for http\Client.
  
 http\Client supports sending parallel requests, optionally driven by an event loop library like libev{,ent}. http\Client supports sending parallel requests, optionally driven by an event loop library like libev{,ent}.
Line 397: Line 390:
  
 == Message == == Message ==
-Docs: http://devel-m6w6.rhcloud.com/mdref/http/Message +  * Docs: http://devel-m6w6.rhcloud.com/mdref/http/Message 
-Current status: essential +  Current status: essential 
-Related functionality in core: rfc1867.c+  Related functionality in core: rfc1867.c
  
 Message parser and tools. http\Message is the base class of all request and response classes. Note that a "parent message" denotes any message appearing before a message in a stream of messages.  Message parser and tools. http\Message is the base class of all request and response classes. Note that a "parent message" denotes any message appearing before a message in a stream of messages. 
Line 408: Line 401:
  
 == Header == == Header ==
-Docs: http://devel-m6w6.rhcloud.com/mdref/http/Header +  * Docs: http://devel-m6w6.rhcloud.com/mdref/http/Header 
-Current status: essential +  Current status: essential 
-Related functionionalty in core: non-existent+  Related functionionalty in core: non-existent
  
 Header parser and tools. Header parser and tools.
  
-I'm really not sure what case I should make about a header and message parser implementation in an HTTP package; as if I would have to argue for a connection and statement implementation in an database access package.+I'm really not sure what case I should make about a header and message parser implementation in an HTTP package.
  
 == Cookie == == Cookie ==
Line 433: Line 426:
  
 == QueryString == == QueryString ==
-Docs: http://devel-m6w6.rhcloud.com/mdref/http/QueryString +  * Docs: http://devel-m6w6.rhcloud.com/mdref/http/QueryString 
-Current status: feature completive +  Current status: feature completive 
-Related functionality in core: parse_str() (php_default_treat_data())+  Related functionality in core: parse_str() (php_default_treat_data())
  
 Query string parser and tools. Actually builds on http\Params. Query string parser and tools. Actually builds on http\Params.
Line 442: Line 435:
  
 == Url == == Url ==
-Docs: http://devel-m6w6.rhcloud.com/mdref/http/Url +  * Docs: http://devel-m6w6.rhcloud.com/mdref/http/Url 
-Current status: essential +  Current status: essential 
-Related functionality in core: parse_url()+  Related functionality in core: parse_url()
  
 URL parser and tools with UTF-8, locale multibyte and IDNA support (need to check if, and how much it diverges from IRIs). See RFC3987 and RFC3988. URL parser and tools with UTF-8, locale multibyte and IDNA support (need to check if, and how much it diverges from IRIs). See RFC3987 and RFC3988.
Line 456: Line 449:
 ===== Vote ===== ===== Vote =====
  
-50%+1 combined "Yes" votes needed for acceptance.+Three way "yes/enabled by default", "yes/disabled by default", "no" where 50%+1 combined "Yes" votes are needed for acceptance
 + 
 +<doodle title="Add pecl_http to the core?" auth="mike" voteType="single" closed="true"> 
 +   * Yes, enabled by default 
 +   * Yes, disabled by default 
 +   * No 
 +</doodle> 
 + 
 +\\  
 +\\  
 +Additional simple vote on the namespace prefix ("http" or "php\http") disregarding the case. 
 + 
 +<doodle title="Namespace prefix for pecl_http" auth="mike" voteType="single" closed="true"> 
 +   * http 
 +   * php\http 
 +</doodle> 
 + 
 +===== Discussed and changed items ===== 
 + 
 +== Parsing multipart/form-data and a/www-form-url-encoded for any request method == 
 + 
 +This functionality was removed from the proposal. 
 + 
 +== Parsing a/json into $_POST == 
 + 
 +This functionality was removed from the proposal, which removed the ext/json dependency. 
 + 
 +== Translating charsets of http\QueryString == 
 + 
 +This functionality was removed from the proposal, which removed the ext/iconv dependency. 
 + 
 +== Extended hashing methods for ETags of dynamic content == 
 + 
 +This functionality was removed from the proposal, which removed the ext/hash dependency. 
 + 
 +== Splitting up into smaller RFCs == 
 + 
 +It was requested to split this RFC up into more smaller ones, but mainly only, as observed by me, to *not* bring an HTTP client implementation into the default distribution. These requests were not considered further by me, because I think the client gives substantial value to the overall package. 
 + 
 +== Upgrade path for existing pecl_http users == 
 + 
 +A pecl_http integraded into the default distribution would be considered v3. Upcoming v2 releases could take measures to prepare any transition to the PHP7 API. 
 + 
 +== Namespace choice, or the case of the case == 
 + 
 +I consider this issue non-important, because we do not rely on the case for internal classes, so ''http'', ''HTTP'' and ''Http'' only have cosmetic effect. 
 + 
 +There will be an extra vote on whether to prefix the ''http'' namespace with ''php''. Here, I consider ''PHP'', ''php'' and ''Php'' to be equal as well.
  
 ===== Changelog ===== ===== Changelog =====
Line 475: Line 515:
   * 2.2   * 2.2
     * Removed optional dependencies on all three extensions (json, iconv, hash), and the one INI entry related to it     * Removed optional dependencies on all three extensions (json, iconv, hash), and the one INI entry related to it
 +  * 2.3
 +    * Removed http\Env RINIT section
 +    * Changed namespace from ''http'' to ''Http''
 +    * Fixed some wordings and list formattings
 +  * 2.4
 +    * Added "Discussed and changed items"
rfc/pecl_http.1422625206.txt.gz · Last modified: 2017/09/22 13:28 (external edit)