public function __construct() { if (!php_Boot::$skip_constructor) { $this->method = eval("if(isset(\$this)) \$»this =& \$this;switch(strtoupper(php_Web::getMethod())) {\n\t\t\tcase \"GET\":{\n\t\t\t\t\$»r = sinatra_HTTPMethod::\$GET;\n\t\t\t}break;\n\t\t\tcase \"POST\":{\n\t\t\t\t\$»r = sinatra_HTTPMethod::\$POST;\n\t\t\t}break;\n\t\t\tcase \"PUT\":{\n\t\t\t\t\$»r = sinatra_HTTPMethod::\$PUT;\n\t\t\t}break;\n\t\t\tcase \"DELETE\":{\n\t\t\t\t\$»r = sinatra_HTTPMethod::\$DELETE;\n\t\t\t}break;\n\t\t\tdefault:{\n\t\t\t\t\$»r = eval(\"if(isset(\\\$this)) \\\$»this =& \\\$this;throw new HException(\\\"Invalid HTTP Method\\\");\n\t\t\t\t\treturn \\\$»r2;\n\t\t\t\t\");\n\t\t\t}break;\n\t\t\t}\n\t\t\treturn \$»r;\n\t\t"); $this->params = php_Web::getParams(); $this->uri = sinatra_utils_URI::parse(php_Web::getURI()); $this->path = $this->uri->path; $this->headers = new Hash(); $»it = php_Web::getClientHeaders()->iterator(); while ($»it->hasNext()) { $h = $»it->next(); $this->headers->set($h->header, $h->value); } } }
static function getClientHeader($k) { $k1 = str_replace("-", "_", strtoupper($k)); if (null == php_Web::getClientHeaders()) { throw new HException('null iterable'); } $»it = php_Web::getClientHeaders()->iterator(); while ($»it->hasNext()) { $i = $»it->next(); if ($i->header === $k1) { return $i->value; } } return null; }
static function get_http_headers() { return php_Web::getClientHeaders(); }