예제 #1
0
 /**
  * Import hosts.
  *
  * @throws Exception
  */
 protected function processHosts()
 {
     if ($hosts = $this->getFormattedHosts()) {
         $hostImporter = new CHostImporter($this->options, $this->referencer);
         $hostImporter->import($hosts);
     }
 }
예제 #2
0
 /**
  * Import hosts.
  *
  * @throws Exception
  */
 protected function processHosts()
 {
     if ($this->options['hosts']['updateExisting'] || $this->options['hosts']['createMissing']) {
         $hosts = $this->getFormattedHosts();
         if ($hosts) {
             $hostImporter = new CHostImporter($this->options, $this->referencer, $this->importedObjectContainer);
             $hostImporter->import($hosts);
             // get list of imported host IDs and add them processed host ID list
             $hostIds = $hostImporter->getProcessedHostIds();
             $this->importedObjectContainer->addHostIds($hostIds);
         }
     }
 }