Beispiel #1
0
 function execute(InputInterface $input, OutputInterface $output)
 {
     $filename = $input->getArgument('filename');
     $output->write("Processing '" . $filename . "'\n");
     //TODO: Handle this through autoloading
     $root = LinkORB_Core::GetPath("root");
     $topic = new Topic();
     $topic->name = 'Root';
     if (!$topic->load($filename)) {
         Console::Error("Unable to load map file.");
         exit(1);
     }
     $topic->TopicL10N();
     $output->write('DONE');
     exit(0);
 }
Beispiel #2
0
 /**
  * notification of event occurence
  * @access package private
  * @param Event event the event to handle
  */
 public function handle($event)
 {
     try {
         if (is_callable($this->_callback)) {
             call_user_func($this->_callback, $event);
         } else {
             Console::Error('Callback failed for event ' . $event->getEventType() . ' : not callable');
         }
     } catch (Exception $e) {
         Console::Error('[Exception] in callback for event ' . $event->getEventType() . ' : ' . ' : ' . $e);
     }
 }
Beispiel #3
0
 function loadMap($filename)
 {
     if (!file_exists($filename)) {
         Console::Error('Map file does not exist: ' . $filename);
         return false;
     }
     $this->xml = @simplexml_load_file($filename);
     if (!$this->xml) {
         Console::Error('Incorrectly formatted XML in ' . $filename);
         return false;
     }
     return $this->ParseMap($this->xml);
 }