Example #1
0
 function __construct($siteID, $nodeID)
 {
     $this->site_id = $siteID;
     $this->node_id = $nodeID;
     // init core
     $core = core::selfie();
     $this->psat = core::module('sat');
     $this->collection = $this->psat->get_node_handle();
     if (!($this->site = $this->psat->get_site($this->site_id))) {
         throw new tf_exception('Bad site');
     }
     if (!($this->node = $this->psat->get_node($this->node_id))) {
         throw new tf_exception('Bad node');
     }
 }
Example #2
0
 function run($file)
 {
     if (empty($file) || !file_exists($file)) {
         throw new tf_exception('Empty file');
     }
     $response = file_get_contents($file);
     $xmldoc = new SimpleXMLElement($response);
     $this->module = core::module('sat');
     $this->collection = $this->module->get_node_handle();
     $this->collection->remove_all_fast();
     foreach ($xmldoc->node as $node) {
         $this->import_node($node);
     }
     $this->collection->sync_children_count();
 }