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