本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例5: afterAction
public function afterAction($action, $params, $exitCode = 0)
{
Console::writeLine('Command ended');
return parent::afterAction($action, $params, $exitCode);
}
示例6: afterAction
protected function afterAction($action, $params, $exitCode = 0)
{
$this->isDone = true;
return parent::afterAction($action, $params, $exitCode);
}
示例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();
}