public function __construct($httpContext)
 {
     if (!php_Boot::$skip_constructor) {
         ufront_web_HttpError::throwIfNull($httpContext, "httpContext", _hx_anonymous(array("fileName" => "ActionContext.hx", "lineNumber" => 80, "className" => "ufront.web.context.ActionContext", "methodName" => "new")));
         $this->httpContext = $httpContext;
     }
 }
 public function execute($httpContext)
 {
     ufront_web_HttpError::throwIfNull($httpContext, "httpContext", _hx_anonymous(array("fileName" => "UfrontApplication.hx", "lineNumber" => 173, "className" => "ufront.app.UfrontApplication", "methodName" => "execute")));
     if ($this->firstRun) {
         $this->initOnFirstExecute($httpContext);
     }
     if (null == $this->configuration->apis) {
         throw new HException('null iterable');
     }
     $__hx__it = $this->configuration->apis->iterator();
     while ($__hx__it->hasNext()) {
         unset($api);
         $api = $__hx__it->next();
         $httpContext->injector->mapRuntimeTypeOf($api, null)->_toSingleton($api);
         $asyncApi = ufront_api_UFAsyncApi::getAsyncApi($api);
         if ($asyncApi !== null) {
             $httpContext->injector->mapRuntimeTypeOf($asyncApi, null)->_toSingleton($asyncApi);
         }
         unset($asyncApi);
     }
     return parent::execute($httpContext);
 }
 public function addUrlFilter($filter)
 {
     ufront_web_HttpError::throwIfNull($filter, "filter", _hx_anonymous(array("fileName" => "HttpApplication.hx", "lineNumber" => 565, "className" => "ufront.app.HttpApplication", "methodName" => "addUrlFilter")));
     $this->urlFilters->push($filter);
 }
 public function setHeader($name, $value)
 {
     ufront_web_HttpError::throwIfNull($name, null, _hx_anonymous(array("fileName" => "HttpResponse.hx", "lineNumber" => 201, "className" => "ufront.web.context.HttpResponse", "methodName" => "setHeader")));
     ufront_web_HttpError::throwIfNull($value, null, _hx_anonymous(array("fileName" => "HttpResponse.hx", "lineNumber" => 202, "className" => "ufront.web.context.HttpResponse", "methodName" => "setHeader")));
     $this->_headers->set($name, $value);
 }
 public function __construct($request, $response, $appInjector = null, $session = null, $auth = null, $urlFilters = null, $relativeContentDir = null)
 {
     if (!php_Boot::$skip_constructor) {
         if ($relativeContentDir === null) {
             $relativeContentDir = "uf-content";
         }
         ufront_web_HttpError::throwIfNull($response, null, _hx_anonymous(array("fileName" => "HttpContext.hx", "lineNumber" => 214, "className" => "ufront.web.context.HttpContext", "methodName" => "new")));
         ufront_web_HttpError::throwIfNull($request, null, _hx_anonymous(array("fileName" => "HttpContext.hx", "lineNumber" => 215, "className" => "ufront.web.context.HttpContext", "methodName" => "new")));
         $this->request = $request;
         $this->response = $response;
         if ($urlFilters !== null) {
             $this->urlFilters = $urlFilters;
         } else {
             $this->urlFilters = new _hx_array(array());
         }
         $this->_relativeContentDir = $relativeContentDir;
         $this->actionContext = new ufront_web_context_ActionContext($this);
         $this->messages = new _hx_array(array());
         $this->completion = 0;
         if ($appInjector !== null) {
             $this->injector = $appInjector->createChildInjector();
         } else {
             $this->injector = new minject_Injector(null);
         }
         $this->injector->mapType("ufront.web.context.HttpContext", null, null)->toValue($this);
         $this->injector->mapType("ufront.web.context.HttpRequest", null, null)->toValue($request);
         $this->injector->mapType("ufront.web.context.HttpResponse", null, null)->toValue($response);
         $this->injector->mapType("ufront.web.context.ActionContext", null, null)->toValue($this->actionContext);
         $this->injector->mapType("ufront.log.MessageList", null, null)->toValue(new ufront_log_MessageList($this->messages, null));
         $this->injector->mapType("minject.Injector", null, null)->toValue($this->injector);
         if ($session !== null) {
             $this->session = $session;
         }
         if ($this->session === null) {
             try {
                 $this->session = $this->injector->getValueForType("ufront.web.session.UFHttpSession", null);
             } catch (Exception $__hx__e) {
                 $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
                 $e = $_ex_;
                 $msg = "Failed to load UFHttpSession: " . Std::string($e) . ". Using VoidSession instead." . _hx_string_or_null(haxe_CallStack::toString(haxe_CallStack::exceptionStack()));
                 $this->messages->push(_hx_anonymous(array("msg" => $msg, "pos" => _hx_anonymous(array("fileName" => "HttpContext.hx", "lineNumber" => 236, "className" => "ufront.web.context.HttpContext", "methodName" => "new")), "type" => ufront_log_MessageType::$MLog)));
             }
         }
         if ($this->session === null) {
             $this->session = new ufront_web_session_VoidSession();
         }
         $this->injector->mapType("ufront.web.session.UFHttpSession", null, null)->toValue($this->session);
         $this->injector->mapRuntimeTypeOf($this->session, null)->toValue($this->session);
         if ($auth !== null) {
             $this->auth = $auth;
         }
         if ($this->auth === null) {
             try {
                 $this->auth = $this->injector->getValueForType("ufront.auth.UFAuthHandler", null);
             } catch (Exception $__hx__e) {
                 $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
                 $e1 = $_ex_;
                 $msg1 = "Failed to load UFAuthHandler: " . Std::string($e1) . ". Using NobodyAuthHandler instead." . _hx_string_or_null(haxe_CallStack::toString(haxe_CallStack::exceptionStack()));
                 $this->messages->push(_hx_anonymous(array("msg" => $msg1, "pos" => _hx_anonymous(array("fileName" => "HttpContext.hx", "lineNumber" => 244, "className" => "ufront.web.context.HttpContext", "methodName" => "new")), "type" => ufront_log_MessageType::$MLog)));
             }
         }
         if ($this->auth === null) {
             $this->auth = new ufront_auth_NobodyAuthHandler();
         }
         $this->injector->mapType("ufront.auth.UFAuthHandler", null, null)->toValue($this->auth);
         $this->injector->mapRuntimeTypeOf($this->auth, null)->toValue($this->auth);
     }
 }