Eric Lippmann 7cef06f981 Disable benchmark only if the layout is disabled
Benchmark should be disabled if the response is not HTML. This is most likely the case when the layout is disabled.
If Web 2 or Zend sends JSON for example, the layout is disabled.

The follwing code inside an action disables the layout (and view):
$this->_helper->layout()->disableLayout();

The following code inside an action disables the action's view script:
$this->_helper->viewRenderer->setNoRender(true);

Note that an action's view script is also disabled via setNoRender() when rendering another view script via
render() or renderScript().

Another appraoch is to check the content-type. If explicitly set to not HTML, disable benchmark:

$renderBenchmark = true;
$response = $this->getResponse();
$headers = $response->getHeaders();
foreach ($headers as $header) {
    if (strtolower($header['name']) === 'content-type'
        && stristr($header['value'], 'text/html') === false
    ) {
        $renderBenchmark = false;
        break;
    }
}
if ($renderBenchmark) {
    $layout->benchmark = $this->renderBenchmark();
}

Maybe we should also provide a action method for disabling benchmark, regardless of the user's setting.

refs #10856
2016-02-27 20:14:02 +01:00
2016-02-08 15:54:48 +01:00
2015-11-26 11:17:32 +01:00
2015-12-22 14:20:02 +01:00
2015-12-22 14:20:02 +01:00
2015-12-22 14:49:52 +01:00
2013-07-03 14:17:48 +02:00
2015-09-30 18:17:27 +02:00
2015-12-23 14:21:56 +01:00

Icinga Web 2

Table of Contents

  1. About
  2. Installation
  3. Support

About

Icinga Web 2 is the next generation open source monitoring web interface, framework and command-line interface developed by the Icinga Project, supporting Icinga 2, Icinga Core and any other monitoring backend compatible with the Livestatus Protocol.

Icinga Web 2

Installation

For installing Icinga Web 2 please read doc/installation.md.

Support

If you come across problems at some time, the community support channels are good places to ask for advice from other users and give some in return.

For status updates check the Icinga website and the Icinga Web 2 development roadmap.

Description
A lightweight and extensible web interface to keep an eye on your environment. Analyse problems and act on them.
Readme GPL-2.0 74 MiB
Languages
PHP 81.7%
HTML 9.1%
JavaScript 5.6%
Less 3.6%