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:
parent
55ad2dd65f
commit
9060e8a034
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ namespace Icinga\Test {
|
|||
*/
|
||||
public function getRequestMock()
|
||||
{
|
||||
return Icinga::app()->getFrontController()->getRequest();
|
||||
return Icinga::app()->getRequest();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -75,6 +75,6 @@ class Button extends FormElement
|
|||
*/
|
||||
protected function getRequest()
|
||||
{
|
||||
return Icinga::app()->getFrontController()->getRequest();
|
||||
return Icinga::app()->getRequest();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ class Url
|
|||
if ($app->isCli()) {
|
||||
return new FakeRequest();
|
||||
} else {
|
||||
return $app->getFrontController()->getRequest();
|
||||
return $app->getRequest();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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'))) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue