Ejemplo n.º 1
0
 /**
  * Returns a command line parser instance built from an xml string.
  *
  * Example:
  * <code>
  * require_once 'Console/CommandLine.php';
  * $xmldata = '<?xml version="1.0" encoding="utf-8" standalone="yes"?>
  * <command>
  *   <description>Compress files</description>
  *   <option name="quiet">
  *     <short_name>-q</short_name>
  *     <long_name>--quiet</long_name>
  *     <description>be quiet when run</description>
  *     <action>StoreTrue/action>
  *   </option>
  *   <argument name="files">
  *     <description>a list of files</description>
  *     <multiple>true</multiple>
  *   </argument>
  * </command>';
  * $parser = Console_CommandLine::fromXmlString($xmldata);
  * $result = $parser->parse();
  * </code>
  *
  * @param string $string The xml data
  *
  * @return Console_CommandLine The parser instance
  */
 public static function fromXmlString($string)
 {
     include_once 'Console/CommandLine/XmlParser.php';
     return Console_CommandLine_XmlParser::parseString($string);
 }
Ejemplo n.º 2
0
 /**
  * Returns a command line parser instance built from an xml string.
  *
  * Example:
  * <code>
  * require_once 'Console/CommandLine.php';
  * $xmldata = '<?xml version="1.0" encoding="utf-8" standalone="yes"?>
  * <command>
  *   <description>Compress files</description>
  *   <option name="quiet">
  *     <short_name>-q</short_name>
  *     <long_name>--quiet</long_name>
  *     <description>be quiet when run</description>
  *     <action>StoreTrue/action>
  *   </option>
  *   <argument name="files">
  *     <description>a list of files</description>
  *     <multiple>true</multiple>
  *   </argument>
  * </command>';
  * $parser = Console_CommandLine::fromXmlString($xmldata);
  * $result = $parser->parse();
  * </code>
  *
  * @param string $string The xml data
  *
  * @return Console_CommandLine The parser instance
  */
 public static function fromXmlString($string)
 {
     return Console_CommandLine_XmlParser::parseString($string);
 }