Request: Add getResponse() to retrieve the Response

refs #7383
This commit is contained in:
Alexander Fuhr 2015-08-13 11:19:08 +02:00
parent ad8f16c185
commit 2332b94f0b
1 changed files with 28 additions and 0 deletions

View File

@ -3,6 +3,7 @@
namespace Icinga\Web;
use Icinga\Application\Icinga;
use Zend_Controller_Request_Http;
use Icinga\User;
@ -32,6 +33,13 @@ class Request extends Zend_Controller_Request_Http
*/
protected $url;
/**
* Response
*
* @var Response
*/
protected $response;
/**
* Get whether the request seems to be an API request
*
@ -78,6 +86,20 @@ class Request extends Zend_Controller_Request_Http
return $this;
}
/**
* Get the response
*
* @return Response
*/
public function getResponse()
{
if ($this->response === null) {
$this->response = Icinga::app()->getResponse();
}
return $this->response;
}
/**
* Makes an ID unique to this request, to prevent id collisions in different containers
*
@ -96,4 +118,10 @@ class Request extends Zend_Controller_Request_Http
}
return $id . '-' . $this->uniqueId;
}
public function hasCookieSupport()
{
$cookie = new Cookie($this);
return $cookie->isSupported();
}
}