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