function __construct() { $globals = array(); $factory = new WebFactory($globals); $this->response = $factory->newResponse(); $this->response_sender = new ResponseSender($this->response); }
public function setResponderFactory(\Closure $factory) { $responderFactoryProxy = function ($responderName) use($factory) { $webFactory = new WebFactory($GLOBALS); $response = $webFactory->newResponse(); $responder = $factory($responderName); $responder->_setResponse($response); $responder->_init(); return $responder; }; $this->responderFactory = $responderFactoryProxy; }