; This directive determines which super global data (G,P,C,E & S) should
; be registered into the super global array REQUEST. If so, it also determines
; the order in which that data is registered. The values for this directive are
; specified in the same manner as the variables_order directive, EXCEPT one.
; Leaving this value empty will cause PHP to use the value set in the
; variables_order directive. It does not mean it will leave the super globals
; array REQUEST empty.
; Default Value: None
; Development Value: "GP"
; Production Value: "GP"
; http://php.net/request-order

request_order = "GP"


; This directive determines which super global arrays are registered when PHP
; starts up. If the register_globals directive is enabled, it also determines
; what order variables are populated into the global space. G,P,C,E & S are
; abbreviations for the following respective super globals: GET, POST, COOKIE,
; ENV and SERVER. There is a performance penalty paid for the registration of
; these arrays and because ENV is not as commonly used as the others, ENV is
; is not recommended on productions servers. You can still get access to
; the environment variables through getenv() should you need to.
; Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS";
; http://php.net/variables-order

variables_order = "GPCS"

variables_order这个配置项用来指定全局变量EGPCS (Environment, Get, Post, Cookie, and Server)的解析顺序。 如果variables_order被设置为SP,那么PHP会创建$_SERVER$_POST,而不会创建$_ENV$_GET$_COOKIE等变量, 如果被设置为空,那么PHP不会创建任何超级全局变量。


有时候从$_REQUEST中取出的值不是想要的,考虑这样一个场景: 如果在php.ini中设置request_order = “GPCES”,在HTTP请求中GET或者POST参数的name恰好与COOKIE的name相同,假如为foo。 那么在程序中通过$_REQUEST[‘foo’]来获取到的值是名为foo的一个cookie的值,而不是GET或者POST请求的值。



comments powered by Disqus
Powered by Github  &&  Jekyll
Fork me on GitHub