From f66ab8dae2f3d0418759f81a3a64dc9517a62449 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 14 Apr 2024 15:17:31 +0200 Subject: Adding upstream version 1.10.2. Signed-off-by: Daniel Baumann --- application/clicommands/ImportCommand.php | 62 +++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 application/clicommands/ImportCommand.php (limited to 'application/clicommands/ImportCommand.php') diff --git a/application/clicommands/ImportCommand.php b/application/clicommands/ImportCommand.php new file mode 100644 index 0000000..3edfff2 --- /dev/null +++ b/application/clicommands/ImportCommand.php @@ -0,0 +1,62 @@ +db()); + $count = $import->unserializeImportSources(json_decode($json)); + echo "$count Import Sources have been imported\n"; + } + + // /** + // * Import an ImportSource definition + // * + // * USAGE + // * + // * icingacli director import importsource < importsource.json + // * + // * OPTIONS + // */ + // public function importsourcection() + // { + // $json = file_get_contents('php://stdin'); + // $object = ImportSource::import(json_decode($json), $this->db()); + // $object->store(); + // printf("Import Source '%s' has been imported\n", $object->getObjectName()); + // } + + /** + * Import SyncRule definitions + * + * USAGE + * + * icingacli director import syncrules < syncrules.json + */ + public function syncrulesAction() + { + $json = file_get_contents('php://stdin'); + $import = new ImportExport($this->db()); + $count = $import->unserializeSyncRules(json_decode($json)); + echo "$count Sync Rules have been imported\n"; + } +} -- cgit v1.2.3