public function testNonEmpty()
 {
     return;
     $workingdir = getcwd();
     $configFile = Xinc_Config_File::load($workingdir . '/test/resources/testNonEmptySystem.xml');
     $parser = new Xinc_Config_Parser($configFile);
     $plugins = $parser->getPlugins();
     $this->assertTrue($plugins->count() == 1, 'One plugin should be detected');
     $pluginParser = new Xinc_Plugin_Parser();
     $pluginParser->parse($plugins);
     $repository = Xinc_Plugin_Repository::getInstance();
     $plugins = $repository->getPlugins();
     $this->assertTrue($plugins->count() == 1, 'Should have one plugin');
 }
Beispiel #2
0
 /**
  * Set the plugin.xml file and parse it
  * to load the plugins and register the Widgets with the
  * Xinc_Gui_Widget_Repository
  *
  * @param string $fileName
  */
 private function setSystemConfigFile($fileName)
 {
     $fileName = realpath($fileName);
     try {
         //Xinc_Config::parse($fileName);
         $configFile = Xinc_Config_File::load($fileName);
         $configParser = new Xinc_Config_Parser($configFile);
         $plugins = $configParser->getPlugins();
         $pluginParser = new Xinc_Plugin_Parser();
         $pluginParser->parse($plugins);
         $widgets = Xinc_Gui_Widget_Repository::getInstance()->getWidgets();
         foreach ($widgets as $path => $widget) {
             Xinc_Logger::getInstance()->debug('Calling init on: ' . get_class($widget));
             $widget->init();
         }
         Xinc_Logger::getInstance()->debug('INIT calls done.');
         $configSettings = $configParser->getConfigSettings();
         while ($configSettings->hasNext()) {
             $setting = $configSettings->next();
             $attributes = $setting->attributes();
             $name = (string) $attributes->name;
             $value = (string) $attributes->value;
             if ($name == 'loglevel' && Xinc_Logger::getInstance()->logLevelSet()) {
                 $value = Xinc_Logger::getInstance()->getLogLevel();
             }
             $this->setConfigDirective($name, $value);
         }
     } catch (Exception $e) {
         Xinc_Logger::getInstance()->error('error parsing system:' . $e->getMessage());
     }
 }