Пример #1
0
 public function getTaskInfo($taskName)
 {
     Yii::import('site.common.components.cron.*');
     /** @var CActiveRecord $owner  */
     $owner = $this->getOwner();
     $modelName = get_class($owner);
     return CronTask::model()->findByAttributes(array('ownerModel' => $modelName, 'ownerId' => $owner->primaryKey, 'taskName' => $taskName));
 }
Пример #2
0
function __shutdown()
{
    $outStr = ob_get_contents();
    ob_end_clean();
    if (CronTask::$uniqKey) {
        $cronTask = CronTask::model()->findByAttributes(array('uniqKey' => CronTask::$uniqKey));
        if ($cronTask) {
            $cronTask->executeTimestamp = date('Y-m-d H:i:s', CronTask::$executeTimestamp);
            $cronTask->executeOut = $outStr;
            $cronTask->save();
        }
    }
    echo 'all out string:' . $outStr;
}