false, 'value' => null ]; } if (!$GLOBALS['savedSERVER']['saved']){ if (!isset($_SERVER)){ $GLOBALS['savedSERVER']['value'] = null; $GLOBALS['savedSERVER']['saved'] = true; } else { $GLOBALS['savedSERVER']['value'] = $_SERVER; $GLOBALS['savedSERVER']['saved'] = true; } } } /** * revert previous $_SERVER in $GLOBALS if existing */ public function revertSERVER() { if (isset($GLOBALS['savedSERVER']['saved']) && $GLOBALS['savedSERVER']['saved']){ if (is_null($GLOBALS['savedSERVER']['value'])){ unset($_SERVER); } else { $_SERVER = $GLOBALS['savedSERVER']['value']; } $GLOBALS['savedSERVER']['saved'] = false; $GLOBALS['savedSERVER']['value'] = null; } } }