rfc:slim_post_data

Differences

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

Link to this comparison view

Next revision
Previous revision
rfc:slim_post_data [2013/11/19 09:35] – created 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.0 +  * Version: 1.3 
-  * Date: 2013-11-19+  * 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) =====
  
-$HTTP_RAW_POST_DATA and always_populate_raw_post_data were removed.+Next 5.x, i.e. 5.6
  
-BC can be restored with:+===== SAPIs Impacted =====
  
-<code php> +Web-SAPIs.
-$GLOBALS["HTTP_RAW_POST_DATA"] = file_get_contents("php://input"); +
-</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...+===== Unaffected PHP Functionality =====
  
-===== Proposed PHP Version(s) =====+Standard form POSTs and file uploads.
  
-Next 5.x, i.e. 5.6+===== Changes to PHP-5.6 =====
  
-===== SAPIs Impacted =====+  * 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]%%)
  
-Web-SAPIs.+===== Backward Incompatible Changes to master ===== 
 + 
 +$HTTP_RAW_POST_DATA and always_populate_raw_post_data were removed. 
 + 
 +BC can be restored with: 
 + 
 +<code php> 
 +$GLOBALS["HTTP_RAW_POST_DATA"] = file_get_contents("php://input"); 
 +</code>
  
 ===== 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? 
- 
-===== Unaffected PHP Functionality ===== 
- 
-Standard form POSTs and file uploads. 
  
 ===== Future Scope ===== ===== Future Scope =====
Line 72: 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 =====
  
-More or less:+To see the changes already in master, do, more or less:
  
 <code shell> <code shell>
Line 85: Line 84:
  
 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
 +
 +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
  
 ===== References ===== ===== References =====
Line 92: Line 95:
   * http://marc.info/?t=138449998700002&r=1&w=2   * http://marc.info/?t=138449998700002&r=1&w=2
  
 +===== Changes =====
 +
 +  * 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.1384853717.txt.gz · Last modified: 2017/09/22 13:28 (external edit)