protected function init() { parent::init(); $params = $this->getOptions(); $date = strtotime('-1 day'); if (isset($params['date'])) { $date = strtotime($params['date']); } $this->_startTime = date('Y-m-d 00:00:00', $date); $this->_endTime = date('Y-m-d 23:59:59', $date); if (isset($params['deal'])) { $this->_dealType = intval($params['deal']); } if (!in_array($this->_dealType, $this->_houseTypeSet)) { $this->_dealType = 0; } $this->_cursorFile = sprintf('/data1/logs/Repair_JpHouseComboSpreadState_flag_%d.log', $this->_dealType); $this->_email = sprintf('/data1/logs/Repair_JpHouseComboSpreadState-%d.txt', $this->_dealType); $flag = $this->getFlag($this->_cursorFile); if (!empty($flag) && isset($flag['id'])) { $this->_startId = $flag['id']; } if ($this->_startId == 0) { echo sprintf('Usage: launcher.php Repair_JpHouseComboSpreadState [[--date=YYYY-MM-DD] [--deal=[0|1|2|3|4]] [--release=...]]'), PHP_EOL; echo sprintf("%'#35s%'#35s", ' Mr.Jackin ', PHP_EOL); } }
protected function setLog($content, $file = '') { parent::setLog(sprintf('[%s] [%s] %s', date('Y-m-d H:i:s'), $this->_logContentPrefix, $content), $file); }
protected function setLog($content, $file = '') { parent::setLog(sprintf('[%s] %s%s', date('Y-m-d H:i:s'), $content, PHP_EOL), $file); }
protected function init() { parent::init(); }
/** * Redis连接 * @return APF_Cache_Redis */ private function initRedis() { self::$redis = APF_Cache_Factory::get_instance()->get_redis('job_flag'); }
/** * 设置日志 * * @param string $content * @param string $file * @return bool|int */ protected function setLog($content, $file = '') { $msg = sprintf('[%s] brokerId=%d %s', date('Y-m-d H:i:s'), $this->_hzBrokerId, $content); return parent::setLog($msg, $file); }
protected function init() { parent::init(); //$file = self::FILEPATH.str_replace('Controller', '', get_called_class()); //$file = $file.date("Ymd",strtotime("-1 day"))."_stop.log"; }