lib: Only call Icinga::app()->getRequest() for getting the request outside of a controller

Saves a call to getFrontController().

refs #9660
This commit is contained in:
Eric Lippmann 2015-07-30 14:02:44 +02:00
parent 55ad2dd65f
commit 9060e8a034
9 changed files with 9 additions and 9 deletions

View File

@ -111,7 +111,7 @@ class PivotTable
*/
protected function getPaginationParameter($axis, $param, $default = null)
{
$request = Icinga::app()->getFrontController()->getRequest();
$request = Icinga::app()->getRequest();
$value = $request->getParam($param, '');
if (strpos($value, ',') > 0) {

View File

@ -435,7 +435,7 @@ class SimpleQuery implements QueryInterface, Queryable, Iterator
if ($itemsPerPage === null || $pageNumber === null) {
// Detect parameters from request
$request = Icinga::app()->getFrontController()->getRequest();
$request = Icinga::app()->getRequest();
if ($itemsPerPage === null) {
$itemsPerPage = $request->getParam('limit', 25);
}

View File

@ -180,7 +180,7 @@ namespace Icinga\Test {
*/
public function getRequestMock()
{
return Icinga::app()->getFrontController()->getRequest();
return Icinga::app()->getRequest();
}
/**

View File

@ -1252,7 +1252,7 @@ class Form extends Zend_Form
public function getRequest()
{
if ($this->request === null) {
$this->request = Icinga::app()->getFrontController()->getRequest();
$this->request = Icinga::app()->getRequest();
}
return $this->request;

View File

@ -75,6 +75,6 @@ class Button extends FormElement
*/
protected function getRequest()
{
return Icinga::app()->getFrontController()->getRequest();
return Icinga::app()->getRequest();
}
}

View File

@ -68,7 +68,7 @@ class Response extends Zend_Controller_Response_Http
public function getRequest()
{
if ($this->request === null) {
$this->request = Icinga::app()->getFrontController()->getRequest();
$this->request = Icinga::app()->getRequest();
}
return $this->request;
}

View File

@ -102,7 +102,7 @@ class Url
if ($app->isCli()) {
return new FakeRequest();
} else {
return $app->getFrontController()->getRequest();
return $app->getRequest();
}
}

View File

@ -116,7 +116,7 @@ class SortBox extends AbstractWidget
{
if ($this->query !== null) {
if ($request === null) {
$request = Icinga::app()->getFrontController()->getRequest();
$request = Icinga::app()->getRequest();
}
if (($sort = $request->getParam('sort'))) {

View File

@ -309,7 +309,7 @@ EOT;
private function renderRefreshTab()
{
$url = Icinga::app()->getFrontController()->getRequest()->getUrl();
$url = Icinga::app()->getRequest()->getUrl();
$tab = $this->get($this->getActiveName());
if ($tab !== null) {