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


PHP CConsoleCommand::run方法代码示例

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


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

示例1: run

 public function run($args)
 {
     \Yii::getLogger()->autoFlush = 1;
     \Yii::getLogger()->detachEventHandler('onFlush', [\Yii::app()->log, 'collectLogs']);
     \Yii::getLogger()->attachEventHandler('onFlush', [$this, 'processLogs']);
     parent::run($args);
 }
开发者ID:herroffizier,项目名称:yiiq,代码行数:7,代码来源:Base.php

示例2: run

 public function run($args)
 {
     if (in_array('verbose', $args)) {
         $this->outputLog = true;
     }
     parent::run($args);
 }
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:7,代码来源:CronMoveFollowUpAppointmentsCommand.php

示例3: run

 /**
  * Deciding if we are running the command locally or on Iron Workers
  * @see CConsoleCommand::run()
  * @param $args array
  * @return If run locally the exit code. If run as IronWorker the ironWorker id.
  */
 public function run($args)
 {
     //Store the parameters passed to the function, will be used to pass on to the iron workers
     $this->yiicParams = $args;
     //Add in the command name
     array_unshift($this->yiicParams, $this->getName());
     //Add in the entry script name
     array_unshift($this->yiicParams, "./" . $this->getCommandRunner()->getScriptName());
     CVarDumper::dump($this->yiicParams, 100, false);
     if ($this->isIronWorker()) {
         $this->ironWorker = true;
         //Kick the command off to Iron Workers
         $resId = $this->runAsIronWorker();
         echo "Task " . $resId . " pushed to Iron Worker!\n";
         //When run as an iron worker we return the IronWorker id
         return $resId;
     } else {
         parent::run($args);
     }
 }
开发者ID:br0sk,项目名称:yiiron,代码行数:26,代码来源:EIronWorkersCommand.php

示例4: run

 /**
  * Converts unnamed arguments to named.
  * Uses current action params as names.
  */
 public function run($args)
 {
     list($action, $options, $args) = $this->resolveRequest($args);
     $methodName = 'action' . $action;
     if (!preg_match('/^\\w+$/', $action) || !method_exists($this, $methodName)) {
         $this->usageError("Unknown action: " . $action);
     }
     $method = new ReflectionMethod($this, $methodName);
     foreach ($method->getParameters() as $i => $param) {
         if (!empty($args)) {
             $options[$param->getName()] = array_shift($args);
         }
     }
     $args2 = array($action);
     foreach ($options as $key => $value) {
         $args2[] = '--' . $key . ($value !== true ? '=' . $value : '');
     }
     $args2 = array_merge($args2, $args);
     return parent::run($args2);
 }
开发者ID:urmaul,项目名称:cleanapp,代码行数:24,代码来源:ConsoleCommand.php

示例5: run

 public function run($args)
 {
     parent::run($args);
 }
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:4,代码来源:FeedCommand.php


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