Exemplo n.º 1
0
 /**
  * Will map $_POST, $_GET $_FILES $_SERVER $_SESSION (if started) $_COOKIE $_REQUEST and $_ENV to the $php object
  * @global \stdClass $php
  * @return \stdClass $php
  */
 public static function Query()
 {
     global $php;
     $php = new \stdClass();
     $globals = array("post" => $_POST, "get" => $_GET, "files" => $_FILES, "server" => $_SERVER, "session" => isset($_SESSION) ? $_SESSION : null, "cookie" => $_COOKIE, "request" => $_REQUEST, "env" => $_ENV);
     try {
         foreach ($globals as $key => $value) {
             $php->{$key} = \BTRAutoMap::ArrayToObject($value);
         }
     } catch (\Exception $ex) {
         if (error_reporting() == E_ALL) {
             error_log($ex->getTrace());
         }
     }
     return $php;
 }