當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CConsoleCommand::afterAction方法代碼示例

本文整理匯總了PHP中CConsoleCommand::afterAction方法的典型用法代碼示例。如果您正苦於以下問題:PHP CConsoleCommand::afterAction方法的具體用法?PHP CConsoleCommand::afterAction怎麽用?PHP CConsoleCommand::afterAction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CConsoleCommand的用法示例。


在下文中一共展示了CConsoleCommand::afterAction方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: afterAction

 protected function afterAction($action, $params, $exitCode = 0)
 {
     if (isset($this->service['name'])) {
         $this->log("SERVICE: Service {$this->service['name']} exited with code {$exitCode} [PID: {$this->pid}] ");
         ServiceManager::markAsStopped($this->service['name'], $this->id);
     }
     return parent::afterAction($action, $params, $exitCode);
 }
開發者ID:reggi49,項目名稱:plansys,代碼行數:8,代碼來源:Service.php

示例2: afterAction

 public function afterAction($action, $params, $exitCode = 0)
 {
     if ($this->outputLog) {
         echo implode("\n", $this->_log) . "\n";
     }
     array_unshift($this->_log, 'Launched at: ' . date("Y-m-d H:i:s"));
     file_put_contents(Yii::app()->params['logDirPath'] . '/moveFollowUpAppointment.log', implode("\n", $this->_log), FILE_APPEND);
     return parent::afterAction($action, $params, $exitCode);
 }
開發者ID:jankichaudhari,項目名稱:yii-site,代碼行數:9,代碼來源:CronMoveFollowUpAppointmentsCommand.php

示例3: afterAction

 /**
  * (non-PHPdoc)
  * @see CConsoleCommand::afterAction()
  */
 protected function afterAction($action, $params, $exitCode = 0)
 {
     $dirPath = Yii::app()->runtimePath . '/locks/';
     $commandName = $this->getName();
     $lockFileName = "{$commandName}_{$action}_.lock";
     $lockFilePath = $dirPath . $lockFileName;
     if (file_exists($lockFilePath)) {
         unlink($lockFilePath);
     }
     return parent::afterAction($action, $params, $exitCode);
 }
開發者ID:xiaoxiaochengxyuan,項目名稱:kshenghuo,代碼行數:15,代碼來源:ConsoleCommand.php

示例4: afterAction

 protected function afterAction($action, $params, $exitCode = 0)
 {
     \Yii::log("Unlock after action", \CLogger::LEVEL_TRACE, self::CATEGORY);
     unlink($this->lockFile);
     return parent::afterAction($action, $params, $exitCode);
 }
開發者ID:Wazelin,項目名稱:yii-locked-console-command,代碼行數:6,代碼來源:LockedCommand.php

示例5: afterAction

 public function afterAction($action, $params, $exitCode = 0)
 {
     Console::writeLine('Command ended');
     return parent::afterAction($action, $params, $exitCode);
 }
開發者ID:evgeniys-hyuna,項目名稱:leadsite,代碼行數:5,代碼來源:ExecutorTestCommand.php

示例6: afterAction

 protected function afterAction($action, $params, $exitCode = 0)
 {
     $this->isDone = true;
     return parent::afterAction($action, $params, $exitCode);
 }
開發者ID:eugenesavenko,項目名稱:migraptor,代碼行數:5,代碼來源:MigraptorCommand.php

示例7: afterAction

 /**
  * Log the command was run into cron log table and email to DEV_EMAILS cron log result
  *
  * @param string $action
  * @param array  $params
  * @param int    $exitCode
  *
  * @return int|void
  */
 public function afterAction($action, $params, $exitCode = 0)
 {
     parent::afterAction($action, $params, $exitCode = 0);
     $commandName = $_SERVER['argv'][1];
     $params = json_encode($params);
     $serverName = gethostname();
     $model = new CronLog();
     $model->command_name = $commandName;
     $model->params = $params;
     $model->server_name = $serverName;
     $logFile = $this->getLogFile();
     $model->run_log = @file_get_contents($logFile);
     if ($this->emailLog) {
         $logs = "{$commandName} is run at " . date('m/d/Y h:i:s') . "\n";
         $logs .= 'Parameters: ' . print_r($_SERVER['argv'], 1) . "\n";
         $logs .= $this->getLogs();
         $logs .= print_r($_SERVER, 1);
         xmail($commandName . ' run log', nl2br($logs), SETTINGS_DEV_EMAILS);
     }
     @unlink($logFile);
     $model->save();
 }
開發者ID:hung5s,項目名稱:yap,代碼行數:31,代碼來源:XConsoleCommand.php


注:本文中的CConsoleCommand::afterAction方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。