rfc:slim_post_data

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:slim_post_data [2013/11/28 08:39] – [Open Issues] BR mikerfc:slim_post_data [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 1: Line 1:
  
 ====== PHP RFC: Slim POST data ====== ====== PHP RFC: Slim POST data ======
-  * Version: 1.1 +  * Version: 1.3 
-  * Date: 2013-11-27+  * Date: 2013-12-17
   * Author: Michael Wallner <mike@php.net>   * Author: Michael Wallner <mike@php.net>
-  * Status: Thought it's done already+  * Status: Accepted
   * First Published at: https://wiki.php.net/rfc/slim_post_data   * First Published at: https://wiki.php.net/rfc/slim_post_data
  
 ===== Introduction ===== ===== Introduction =====
  
-This is not a new feature per-se. +memory usage improvement regarding receiving HTTP payloads with a potential reduction of 200-300%.
- +
-It is a memory usage improvement regarding receiving HTTP payloads with a potential reduction of 200-300%.+
  
 ===== Proposal ===== ===== Proposal =====
Line 21: Line 19:
 If the request had another request method or an unrecognized content type, the payload is available through the re-usable, just-in-time %%php://input%% stream. If the request had another request method or an unrecognized content type, the payload is available through the re-usable, just-in-time %%php://input%% stream.
  
-===== Backward Incompatible Changes =====+===== Proposed PHP Version(s) ===== 
 + 
 +Next 5.x, i.e. 5.6 
 + 
 +===== SAPIs Impacted ===== 
 + 
 +Web-SAPIs. 
 + 
 +===== Unaffected PHP Functionality ===== 
 + 
 +Standard form POSTs and file uploads. 
 + 
 +===== Changes to PHP-5.6 ===== 
 + 
 +  * Re-usable, optioanlly JITty initialized %%php://input%% stream 
 +  * Change always_populate_raw_post_data INI setting to accept three values instead of two. 
 +    * -1: The behavior of master; don't ever populate %%$GLOBALS[HTTP_RAW_POST_DATA]%% 
 +    * 0/off/whatever: BC behavior (populate if content-type is not registered or request method is other than POST) 
 +    * 1/on/yes/true: BC behavior (always populate %%$GLOBALS[HTTP_RAW_POST_DATA]%%) 
 + 
 +===== Backward Incompatible Changes to master =====
  
 $HTTP_RAW_POST_DATA and always_populate_raw_post_data were removed. $HTTP_RAW_POST_DATA and always_populate_raw_post_data were removed.
Line 30: Line 48:
 $GLOBALS["HTTP_RAW_POST_DATA"] = file_get_contents("php://input"); $GLOBALS["HTTP_RAW_POST_DATA"] = file_get_contents("php://input");
 </code> </code>
- 
-However, always_populate_raw_post_data may be re-introduced again to mitigate part of this BC issue. It could even be made PHP_INI_USER to further minimize the impact, but I guess it makes no difference if one has to call ini_set or file_get_contents... 
- 
-===== Proposed PHP Version(s) ===== 
- 
-Next 5.x, i.e. 5.6 
- 
-===== SAPIs Impacted ===== 
- 
-Web-SAPIs. 
  
 ===== Impact to Existing Extensions ===== ===== Impact to Existing Extensions =====
Line 57: Line 65:
 +       STR_FREE(post_data_str); +       STR_FREE(post_data_str);
 </code> </code>
- 
-===== Open Issues ===== 
- 
-  * Reintroduce always_populate_raw_post_data?\\ A patch is available that re-introduces always_populate_raw_post_data with the following settings: 
-    * -1: The behavior of PHP-next; don't ever populate %%$GLOBALS[HTTP_RAW_POST_DATA]%% 
-    * 0: BC behavior; populate if content-type is not registered or request method is other than POST 
-    * 1/on/yes/true: BC behavior; always populate %%$GLOBALS[HTTP_RAW_POST_DATA]%% 
- 
-===== Unaffected PHP Functionality ===== 
- 
-Standard form POSTs and file uploads. 
  
 ===== Future Scope ===== ===== Future Scope =====
Line 75: Line 72:
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
  
-  * Yes, leave it as is. +  * Yes 
-  * Yes, but re-introduce always_populate_raw_post_data. +  * No
-  * No, go away.+
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
  
-The original implementation is already in master. See the changes, more or less:+To see the changes already in master, do, more or less:
  
 <code shell> <code shell>
Line 89: Line 85:
 http://git.php.net/?p=php-src.git;a=commitdiff;h=e6084da4735c945cb071c4d9259ea0d702eb77c6;hp=52ff129607a7193cccbc6bdfbf1c1e8586e8d0d2 http://git.php.net/?p=php-src.git;a=commitdiff;h=e6084da4735c945cb071c4d9259ea0d702eb77c6;hp=52ff129607a7193cccbc6bdfbf1c1e8586e8d0d2
  
-patch to re-introduce always_populate_raw_post_data is available here:+Always_populate_raw_post_data patch is available here:
  
 https://github.com/m6w6/php-src/compare/php:PHP-5.6...always_populate_raw_post_data https://github.com/m6w6/php-src/compare/php:PHP-5.6...always_populate_raw_post_data
Line 101: Line 97:
 ===== Changes ===== ===== Changes =====
  
-  * Added PHP-5.6 patch to re-introduce always_populate_raw_post_data (-1/0/1)+  * 1.1 
 +    * Added PHP-5.6 patch to re-introduce always_populate_raw_post_data (-1/0/1) 
 +  * 1.2 
 +    * Re-ordered the RFC and reworded some sections. 
 +  * 1.3 
 +    * Accepted. 
 + 
 +===== Vote ===== 
 +<doodle title="RFC/slim_post_data" auth="mike" voteType="single" closed="true"> 
 +   * Yes 
 +   * No 
 +</doodle>
rfc/slim_post_data.1385627975.txt.gz · Last modified: 2017/09/22 13:28 (external edit)