Import: allow for simple objects (hashes, dicts)
This commit is contained in:
parent
e317b7cf6d
commit
139b52079f
|
@ -6,6 +6,7 @@ use Icinga\Module\Director\Objects\ImportSource;
|
||||||
use Icinga\Module\Director\Util;
|
use Icinga\Module\Director\Util;
|
||||||
use Icinga\Module\Director\Web\Hook\ImportSourceHook;
|
use Icinga\Module\Director\Web\Hook\ImportSourceHook;
|
||||||
use Icinga\Exception\IcingaException;
|
use Icinga\Exception\IcingaException;
|
||||||
|
use stdClass;
|
||||||
|
|
||||||
class Import
|
class Import
|
||||||
{
|
{
|
||||||
|
@ -59,6 +60,9 @@ class Import
|
||||||
if (is_array($pval)) {
|
if (is_array($pval)) {
|
||||||
$pval = json_encode($pval);
|
$pval = json_encode($pval);
|
||||||
$format = 'json';
|
$format = 'json';
|
||||||
|
} elseif ($pval instanceof stdClass) {
|
||||||
|
$pval = json_encode($pval);
|
||||||
|
$format = 'json';
|
||||||
} else {
|
} else {
|
||||||
$format = 'string';
|
$format = 'string';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue