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


PHP Console_CommandLine::displayUsage方法代码示例

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


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

示例1: process

 /**
  * Process command
  *
  * @return  string
  */
 public function process()
 {
     try {
         $this->command = $this->parser->parse();
         if (empty($this->command->command_name)) {
             $this->parser->displayUsage();
             self::end(0);
         }
         $return = $this->controller->execute($this->command->command_name, $this->command->command->options, $this->command->command->args, $this->color, $this->logger, $this->tasks);
     } catch (ShellException $se) {
         $this->parser->displayError($this->color->convert("\n\n%R" . $se->getMessage() . "%n\n"));
         self::end(1);
     } catch (Exception $e) {
         $this->parser->displayError($this->color->convert("\n\n%r" . $e->getMessage() . "%n\n"));
         self::end(1);
     }
     echo "\n" . $return . "\n\n";
     self::end(0);
 }
开发者ID:comodojo,项目名称:extender.framework,代码行数:24,代码来源:Econtrol.php

示例2: stdClass

                $polygon = new stdClass();
                $getPolygon->bindValue('poly', $p, PDO::PARAM_INT);
                $getPolygon->execute();
                $poly = $getPolygon->fetch(PDO::FETCH_NUM);
                $getPolygon->closeCursor();
                $polygon->exterior = ParseLineString($poly[0]);
                // Iterate Holes
                $polygon->holes = array();
                $getPolygonHole->bindValue('poly', $p, PDO::PARAM_INT);
                for ($h = 1; $h <= $poly[1]; ++$h) {
                    $getPolygonHole->bindValue('hole', $h, PDO::PARAM_INT);
                    $getPolygonHole->execute();
                    $hole = $getPolygonHole->fetch(PDO::FETCH_NUM);
                    $getPolygonHole->closeCursor();
                    $polygon->holes[] = ParseLineString($hole[0]);
                }
                $svg[] = PolygonToSVGPath($polygon->exterior, $polygon->holes, $state);
                //$_zone->polygons[] = $polygon;
            }
            //$_zone->svg = implode('',$svg);
            $pos = explode(' ', substr($row[2], 6, -1));
            $pos2 = explode(' ', substr($row[3], 6, -1));
            $zones[$row[0]] = array('left' => (int) $pos[0], 'top' => (int) $pos[1], 'width' => $pos2[0] - $pos[0], 'height' => $pos2[1] - $pos[1], 'svg' => implode('', $svg));
        }
        $allzones->closeCursor();
        echo "Exported " . count($zones) . " zones to " . $args->command->options['outputfile'] . "\n";
        file_put_contents($args->command->options['outputfile'], json_encode($zones));
        break;
    default:
        $parser->displayUsage();
}
开发者ID:Anpu,项目名称:INQ-Calculators,代码行数:31,代码来源:zonemap.php

示例3: main


//.........这里部分代码省略.........
     $listInterfacesCmd->addOption($filterVersionOption);
     $listInterfacesCmd->addOption($filterOperatorOption);
     $listInterfacesCmd->addOption($reportFileOption);
     $listInterfacesCmd->addOption($helpReferenceOption);
     $listInterfacesCmd->addArgument($referenceArgument);
     // list-classes sub-command
     $listClassesCmd = $input->addCommand('list-classes', array('description' => 'List all classes referenced in the data base.'));
     $listClassesCmd->addOption($referenceOption);
     $listClassesCmd->addOption($filterVersionOption);
     $listClassesCmd->addOption($filterOperatorOption);
     $listClassesCmd->addOption($reportFileOption);
     $listClassesCmd->addOption($helpReferenceOption);
     $listClassesCmd->addArgument($referenceArgument);
     // list-functions sub-command
     $listFunctionsCmd = $input->addCommand('list-functions', array('description' => 'List all functions referenced in the data base.'));
     $listFunctionsCmd->addOption($referenceOption);
     $listFunctionsCmd->addOption($filterVersionOption);
     $listFunctionsCmd->addOption($filterOperatorOption);
     $listFunctionsCmd->addOption($reportFileOption);
     $listFunctionsCmd->addOption($helpReferenceOption);
     $listFunctionsCmd->addArgument($referenceArgument);
     // list-constants sub-command
     $listConstantsCmd = $input->addCommand('list-constants', array('description' => 'List all constants referenced in the data base.'));
     $listConstantsCmd->addOption($referenceOption);
     $listConstantsCmd->addOption($filterVersionOption);
     $listConstantsCmd->addOption($filterOperatorOption);
     $listConstantsCmd->addOption($reportFileOption);
     $listConstantsCmd->addOption($helpReferenceOption);
     $listConstantsCmd->addArgument($referenceArgument);
     try {
         $result = $input->parse();
         $command = $result->command_name;
         if (empty($command)) {
             $input->displayUsage(1);
         }
     } catch (Exception $e) {
         $input->displayError($e->getMessage());
     }
     $warnings = array();
     // Loads the default or custom configuration (if available)
     $options = array('reference' => '', 'verbose' => false, 'listeners' => array());
     $reports = array();
     $consoleProgress = true;
     $reportFileAppend = false;
     if ($result->options['noConfiguration'] !== true) {
         if (!isset($result->options['xmlFile'])) {
             // use default configuration
             $dir = '@cfg_dir@' . DIRECTORY_SEPARATOR . 'PHP_CompatInfo';
             if (strpos($dir, '@') === false) {
                 // PEAR installer was used to install the package
             } else {
                 // manual install
                 $dir = getcwd();
             }
             $filename = $dir . DIRECTORY_SEPARATOR . 'phpcompatinfo.xml';
             if (file_exists($filename)) {
                 $config = $filename;
             } elseif (file_exists($filename . '.dist')) {
                 $config = $filename . '.dist';
             } else {
                 $config = false;
             }
         } else {
             $filename = $result->options['xmlFile'];
             if (file_exists($filename)) {
                 $config = realpath($filename);
开发者ID:remicollet,项目名称:php-compat-info,代码行数:67,代码来源:CLI.php


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