class Globals extends \ArrayObject
{
public function __construct
(array $array = []) {
unset($array['GLOBALS']); $treba = array_replace([
'_GET' => [],
'_POST' => [],
'_SERVER' => [],
'_FILES' => [],
'_COOKIE' => [],
'_SESSION' => [],
'_ATTRIBUTES' => []
], $array);
parent::__construct([
'_SERVER' => new \ArrayObject($treba['_SERVER']),
'_GET' => new \ArrayObject($treba['_GET']),
'_POST' => new \ArrayObject($treba['_POST']),
'_COOKIE' => new \ArrayObject($treba['_COOKIE']),
'_SESSION' => new \ArrayObject($treba['_SESSION']),
'_FILES' => new \ArrayObject($treba['_FILES']),
'_ATTRIBUTES' => new \ArrayObject($treba['_ATTRIBUTES'])
]);
}
public function __get($name)
{
if ($this->offsetExists($var)) {
return $this->offsetGet($var);
}
return false;
}
public function __set($name, $value)
{
if ($this->offsetExists($var)) {
return $this->offsetSet($var, $value);
}
return false;
}
}