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


PHP Console_CommandLine::triggerError方法代码示例

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


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

示例1: validate

 /**
  * Validates the argument instance.
  *
  * @return void
  * @throws Console_CommandLine_Exception
  * @todo use exceptions
  */
 public function validate()
 {
     // check if the argument name is valid
     if (!preg_match('/^[a-zA-Z_\\x7f-\\xff]+[a-zA-Z0-9_\\x7f-\\xff]*$/', $this->name)) {
         Console_CommandLine::triggerError('argument_bad_name', E_USER_ERROR, array('{$name}' => $this->name));
     }
     parent::validate();
 }
开发者ID:ntemple,项目名称:intelli-plancake,代码行数:15,代码来源:Argument.php

示例2: validate

 /**
  * Validates the xml definition using Relax NG.
  *
  * @param DomDocument $doc The document to validate
  *
  * @return boolean Whether the xml data is valid or not.
  * @throws Console_CommandLine_Exception
  * @todo use exceptions
  */
 public static function validate($doc)
 {
     if (is_dir('C:\\php\\pear\\data' . DIRECTORY_SEPARATOR . 'Console_CommandLine')) {
         $rngfile = 'C:\\php\\pear\\data' . DIRECTORY_SEPARATOR . 'Console_CommandLine' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'xmlschema.rng';
     } else {
         $rngfile = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'xmlschema.rng';
     }
     if (!is_readable($rngfile)) {
         Console_CommandLine::triggerError('invalid_xml_file', E_USER_ERROR, array('{$file}' => $rngfile));
     }
     return $doc->relaxNGValidate($rngfile);
 }
开发者ID:EmmanuelFernando,项目名称:rapport-stock-control,代码行数:21,代码来源:XmlParser.php

示例3: validate

 /**
  * Validates the xml definition using Relax NG.
  *
  * @param DomDocument $doc The document to validate
  *
  * @return boolean Whether the xml data is valid or not.
  * @throws Console_CommandLine_Exception
  * @todo use exceptions
  */
 public static function validate($doc)
 {
     $pkgRoot = __DIR__ . '/../../';
     $paths = array('@data_dir@/Console_CommandLine/data/xmlschema.rng', $pkgRoot . 'data/Console_CommandLine/data/xmlschema.rng', $pkgRoot . 'data/console_commandline/data/xmlschema.rng', $pkgRoot . 'data/xmlschema.rng', 'xmlschema.rng');
     foreach ($paths as $path) {
         if (is_readable($path)) {
             return $doc->relaxNGValidate($path);
         }
     }
     Console_CommandLine::triggerError('invalid_xml_file', E_USER_ERROR, array('{$file}' => $rngfile));
 }
开发者ID:pear,项目名称:console_commandline,代码行数:20,代码来源:XmlParser.php

示例4: validate

 /**
  * Validates the option instance.
  *
  * @return void
  * @throws Console_CommandLine_Exception
  * @todo use exceptions instead
  */
 public function validate()
 {
     // check if the option name is valid
     if (!preg_match('/^[a-zA-Z_\\x7f-\\xff]+[a-zA-Z0-9_\\x7f-\\xff]*$/', $this->name)) {
         Console_CommandLine::triggerError('option_bad_name', E_USER_ERROR, array('{$name}' => $this->name));
     }
     // call the parent validate method
     parent::validate();
     // a short_name or a long_name must be provided
     if ($this->short_name == null && $this->long_name == null) {
         Console_CommandLine::triggerError('option_long_and_short_name_missing', E_USER_ERROR, array('{$name}' => $this->name));
     }
     // check if the option short_name is valid
     if ($this->short_name != null && !preg_match('/^\\-[a-zA-Z]{1}$/', $this->short_name)) {
         Console_CommandLine::triggerError('option_bad_short_name', E_USER_ERROR, array('{$name}' => $this->name, '{$short_name}' => $this->short_name));
     }
     // check if the option long_name is valid
     if ($this->long_name != null && !preg_match('/^\\-\\-[a-zA-Z]+[a-zA-Z0-9_\\-]*$/', $this->long_name)) {
         Console_CommandLine::triggerError('option_bad_long_name', E_USER_ERROR, array('{$name}' => $this->name, '{$long_name}' => $this->long_name));
     }
     // check if we have a valid action
     if (!is_string($this->action)) {
         Console_CommandLine::triggerError('option_bad_action', E_USER_ERROR, array('{$name}' => $this->name));
     }
     if (!isset(Console_CommandLine::$actions[$this->action])) {
         Console_CommandLine::triggerError('option_unregistered_action', E_USER_ERROR, array('{$action}' => $this->action, '{$name}' => $this->name));
     }
     // if the action is a callback, check that we have a valid callback
     if ($this->action == 'Callback' && !is_callable($this->callback)) {
         Console_CommandLine::triggerError('option_invalid_callback', E_USER_ERROR, array('{$name}' => $this->name));
     }
 }
开发者ID:pear,项目名称:console_commandline,代码行数:39,代码来源:Option.php

示例5: validate

 /**
  * Validate the xml definition using Relax NG
  *
  * @param object $doc a DomDocument instance (the document to validate)
  *
  * @return boolean
  * @access public
  * @static
  */
 public static function validate($doc)
 {
     if (is_dir('/Users/masato/data/svk/bz2/php_parser/trunk/vendor/pear/data' . DIRECTORY_SEPARATOR . 'Console_CommandLine')) {
         $rngfile = '/Users/masato/data/svk/bz2/php_parser/trunk/vendor/pear/data' . DIRECTORY_SEPARATOR . 'Console_CommandLine' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'xmlschema.rng';
     } else {
         $rngfile = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'xmlschema.rng';
     }
     if (!is_readable($rngfile)) {
         Console_CommandLine::triggerError('invalid_xml_file', E_USER_ERROR, array('{$file}' => $rngfile));
     }
     return $doc->relaxNGValidate($rngfile);
 }
开发者ID:hnw,项目名称:php425,代码行数:21,代码来源:XmlParser.php

示例6: validate

 /**
  * Validates the xml definition using Relax NG.
  *
  * @param DomDocument $doc The document to validate
  *
  * @return boolean Whether the xml data is valid or not.
  * @throws Console_CommandLine_Exception
  * @todo use exceptions
  */
 public static function validate($doc) 
 {
     if (is_dir('/Users/nojima/Sites/workspace/twitter2mixi/extlibs/pear/data' . DIRECTORY_SEPARATOR . 'Console_CommandLine')) {
         $rngfile = '/Users/nojima/Sites/workspace/twitter2mixi/extlibs/pear/data' . DIRECTORY_SEPARATOR
             . 'Console_CommandLine' . DIRECTORY_SEPARATOR . 'data' 
             . DIRECTORY_SEPARATOR . 'xmlschema.rng';
     } else {
         $rngfile = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' 
             . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data'
             . DIRECTORY_SEPARATOR . 'xmlschema.rng';
     }
     if (!is_readable($rngfile)) {
         Console_CommandLine::triggerError('invalid_xml_file',
             E_USER_ERROR, array('{$file}' => $rngfile));
     }
     return $doc->relaxNGValidate($rngfile);
 }
开发者ID:nojimage,项目名称:twitter2mixivoice,代码行数:26,代码来源:XmlParser.php


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