mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 13:54:26 +02:00
parent
9219cea776
commit
1a94a21263
@ -9,6 +9,7 @@ use Icinga\Application\Logger\Writer\FileWriter;
|
|||||||
use Icinga\Application\Logger\Writer\SyslogWriter;
|
use Icinga\Application\Logger\Writer\SyslogWriter;
|
||||||
use Icinga\Exception\ConfigurationError;
|
use Icinga\Exception\ConfigurationError;
|
||||||
use Icinga\Exception\IcingaException;
|
use Icinga\Exception\IcingaException;
|
||||||
|
use Icinga\Util\Json;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logger
|
* Logger
|
||||||
@ -251,7 +252,7 @@ class Logger
|
|||||||
function ($a) {
|
function ($a) {
|
||||||
return is_string($a) ? $a : ($a instanceof Exception
|
return is_string($a) ? $a : ($a instanceof Exception
|
||||||
? IcingaException::describe($a)
|
? IcingaException::describe($a)
|
||||||
: json_encode($a));
|
: Json::encode($a));
|
||||||
},
|
},
|
||||||
$arguments
|
$arguments
|
||||||
)
|
)
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
namespace Icinga\Web\Announcement;
|
namespace Icinga\Web\Announcement;
|
||||||
|
|
||||||
|
use Icinga\Util\Json;
|
||||||
use Icinga\Web\Cookie;
|
use Icinga\Web\Cookie;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -128,7 +129,7 @@ class AnnouncementCookie extends Cookie
|
|||||||
*/
|
*/
|
||||||
public function getValue()
|
public function getValue()
|
||||||
{
|
{
|
||||||
return json_encode(array(
|
return Json::encode(array(
|
||||||
'acknowledged' => $this->getAcknowledged(),
|
'acknowledged' => $this->getAcknowledged(),
|
||||||
'etag' => $this->getEtag(),
|
'etag' => $this->getEtag(),
|
||||||
'next' => $this->getNextActive()
|
'next' => $this->getNextActive()
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
namespace Icinga\Web\Response;
|
namespace Icinga\Web\Response;
|
||||||
|
|
||||||
|
use Icinga\Util\Json;
|
||||||
use Zend_Controller_Action_HelperBroker;
|
use Zend_Controller_Action_HelperBroker;
|
||||||
use Icinga\Web\Response;
|
use Icinga\Web\Response;
|
||||||
|
|
||||||
@ -190,7 +191,7 @@ class JsonResponse extends Response
|
|||||||
$body['data'] = $this->getSuccessData();
|
$body['data'] = $this->getSuccessData();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
echo json_encode($body, $this->getEncodingOptions());
|
echo Json::encode($body, $this->getEncodingOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,6 +10,7 @@ use Icinga\Cli\Command;
|
|||||||
use Icinga\File\Csv;
|
use Icinga\File\Csv;
|
||||||
use Icinga\Module\Monitoring\Plugin\PerfdataSet;
|
use Icinga\Module\Monitoring\Plugin\PerfdataSet;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use Icinga\Util\Json;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Icinga monitoring objects
|
* Icinga monitoring objects
|
||||||
@ -78,7 +79,7 @@ class ListCommand extends Command
|
|||||||
$query = $query->getQuery();
|
$query = $query->getQuery();
|
||||||
switch ($format) {
|
switch ($format) {
|
||||||
case 'json':
|
case 'json':
|
||||||
echo json_encode($query->fetchAll());
|
echo Json::encode($query->fetchAll());
|
||||||
break;
|
break;
|
||||||
case 'csv':
|
case 'csv':
|
||||||
Csv::fromQuery($query)->dump();
|
Csv::fromQuery($query)->dump();
|
||||||
|
@ -173,7 +173,7 @@ class RestRequest
|
|||||||
{
|
{
|
||||||
switch ($contentType) {
|
switch ($contentType) {
|
||||||
case 'application/json':
|
case 'application/json':
|
||||||
$payload = json_encode($payload);
|
$payload = Json::encode($payload);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user