I have this code in the root wordpress installation index.php
define('WP_USE_THEMES', true); file_put_contents("/tmp/test.php", print_r($_SERVER, true)); require( dirname( __FILE__ ) . '/wp-blog-header.php' );
I notice that if I comment on the last line so that it only becomes
define('WP_USE_THEMES', true); file_put_contents("/tmp/test.php", print_r($_SERVER, true));
an array printed in /tmp/test.php is deferential !. An array has values ββsuch as
[HTTP_COOKIE] => pll_language=en [REQUEST_URI] => /site_front_page/
Why? and yet the code that the /tmp/test.php file should write is placed before the code
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
in both cases?
EDIT: 1 For example, REQUEST_URI should just be
[REQUEST_URI] => /
source share