Exemple #1
0
/**
 * Output as XML
 *
 * @param array $shellList
 * @return void
 */
	protected function _asXml($shellList) {
		$plugins = CakePlugin::loaded();
		$shells = new SimpleXmlElement('<shells></shells>');
		foreach ($shellList as $name => $location) {
			$source = current($location);
			$callable = $name;
			if (in_array($source, $plugins)) {
				$callable = Inflector::camelize($source) . '.' . $name;
			}
			$shell = $shells->addChild('shell');
			$shell->addAttribute('name', $name);
			$shell->addAttribute('call_as', $callable);
			$shell->addAttribute('provider', $source);
			$shell->addAttribute('help', $callable . ' -h');
		}
		$this->stdout->outputAs(ConsoleOutput::RAW);
		$this->out($shells->saveXml());
	}
 /**
  * Output as XML
  *
  * @param array $shellList The shell list.
  * @return void
  */
 protected function _asXml($shellList)
 {
     $plugins = CakePlugin::loaded();
     $shells = new SimpleXmlElement('<shells></shells>');
     foreach ($shellList as $plugin => $commands) {
         foreach ($commands as $command) {
             $callable = $command;
             if (in_array($plugin, $plugins)) {
                 $callable = Inflector::camelize($plugin) . '.' . $command;
             }
             $shell = $shells->addChild('shell');
             $shell->addAttribute('name', $command);
             $shell->addAttribute('call_as', $callable);
             $shell->addAttribute('provider', $plugin);
             $shell->addAttribute('help', $callable . ' -h');
         }
     }
     $this->stdout->outputAs(ConsoleOutput::RAW);
     $this->out($shells->saveXml());
 }
Exemple #3
0
 /**
  * Output as XML
  *
  * @return void
  */
 protected function _asXml($shellList)
 {
     $plugins = App::objects('plugin');
     $shells = new SimpleXmlElement('<shells></shells>');
     foreach ($shellList as $name => $location) {
         $source = current($location);
         $callable = $name;
         if (in_array($source, $plugins)) {
             $callable = Inflector::underscore($source) . '.' . $name;
         }
         $shell = $shells->addChild('shell');
         $shell->addAttribute('name', $name);
         $shell->addAttribute('call_as', $callable);
         $shell->addAttribute('provider', $source);
         $shell->addAttribute('help', $callable . ' -h');
     }
     $this->out($shells->saveXml());
 }