當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。