当前位置: 首页>>代码示例>>PHP>>正文


PHP Console_CommandLine::fromXmlFile方法代码示例

本文整理汇总了PHP中Console_CommandLine::fromXmlFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Console_CommandLine::fromXmlFile方法的具体用法?PHP Console_CommandLine::fromXmlFile怎么用?PHP Console_CommandLine::fromXmlFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Console_CommandLine的用法示例。


在下文中一共展示了Console_CommandLine::fromXmlFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run()
 {
     $this->concentrator = new Concentrate_Concentrator();
     $this->parser = Console_CommandLine::fromXmlFile($this->getUiXml());
     try {
         $result = $this->parser->parse();
         $this->setOptions($result->options);
         $this->setWebRoot($result->args['webroot']);
         $this->loadDataFiles();
         if ($this->combine) {
             $this->writeCombinedFiles();
             $this->writeCombinedFlagFile();
         }
         if ($this->compile) {
             $this->writeCompiledFiles();
             $this->writeCompiledFlagFile();
         }
         if ($this->minify) {
             $this->writeMinifiedFiles();
             $this->writeMinifiedFlagFile();
         }
     } catch (Console_CommandLine_Exception $e) {
         $this->displayError($e->getMessage() . PHP_EOL);
     } catch (Exception $e) {
         $this->displayError($e->getMessage() . PHP_EOL, false);
         $this->displayError($e->getTraceAsString() . PHP_EOL);
     }
 }
开发者ID:GervaisdeM,项目名称:Concentrate,代码行数:28,代码来源:CLI.php

示例2: getCommandLineParser

 /**
  * Gets the CLI parser for this pinentry
  *
  * @return Console_CommandLine the CLI parser for this pinentry.
  */
 protected function getCommandLineParser()
 {
     return Console_CommandLine::fromXmlFile($this->getUIXML());
 }
开发者ID:remicollet,项目名称:Crypt_GPG,代码行数:9,代码来源:PinEntry.php

示例3: dirname

 * http://opensource.org/licenses/mit-license.php
 *
 * @category  Console 
 * @package   Console_CommandLine
 * @author    David JEAN LOUIS <izimobil@gmail.com>
 * @copyright 2007 David JEAN LOUIS
 * @license   http://opensource.org/licenses/mit-license.php MIT License 
 * @version   CVS: $Id$
 * @link      http://pear.php.net/package/Console_CommandLine
 * @since     File available since release 0.1.0
 */
// Include the Console_CommandLine package.
require_once 'Console/CommandLine.php';
// create the parser
$xmlfile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ex4.xml';
$parser = Console_CommandLine::fromXmlFile($xmlfile);
// run the parser
try {
    $result = $parser->parse();
    if ($result->command_name) {
        $st = $result->command->options['reverse'] ? strrev($result->command->args['text']) : $result->command->args['text'];
        if ($result->command_name == 'foo') {
            echo "Foo says: {$st}\n";
        } else {
            if ($result->command_name == 'bar') {
                echo "Bar says: {$st}\n";
            }
        }
    }
} catch (Exception $exc) {
    $parser->displayError($exc->getMessage());
开发者ID:liujingyu,项目名称:phpuml,代码行数:31,代码来源:ex4.php


注:本文中的Console_CommandLine::fromXmlFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。