public function soapServer($request, $response) {/*{{{*/ $postdata = file_get_contents("php://input"); $function = 'soapServer'; $this->ioLogRecorder->addLog(XDateTime::now()->toString()." service [{$function}] ".$this->ioLogRecorder->format2SimpleLog($postdata)); $configs = ProviderConfigFactory::getProviderAppConfigs(PhoneConference::SPTYPE_HUAWEI, TeleConfProvider::APPTYPE_CONF); $callbackUrl = $configs['callbackUrl']; $server = new SoapServer(null, array('uri' => 'HuaweiConfCallback','location'=>$callbackUrl)); $server->setClass('HuaweiTeleConfApi'); try { $lockName = $this->getLockerName($postdata); $cacher= DAL::get()->getCache(Cacher::CACHETYPE_LOCKER); $locker = LockUtil::factory(LockUtil::LOCK_TYPE_MEMCACHE, array('memcache' => $cacher)); $locker->getLock($lockName); $server->handle(); $locker->releaseLock($lockName); } catch(Exception $ex) { $locker->releaseLock($lockName); } header("HTTP/1.1 202 Accepted"); header("Content-Type: text/xml;charset=UTF-8"); return parent::DIRECT_OUTPUT; }/*}}}*/
public function postSuggestion($request, $response) {/*{{{*/ $suggestion = $request->suggestion; if(!$suggestion) { return false; } if(strlen($suggestion)<=1) { $this->message("输入信息过少, 请重新输入!", $response); return false; } $tel = $request->tel; $email = $request->email; $name = $request->userName; $content = "来自 ".$_SERVER['REMOTE_ADDR']." 的用户发送了一条意见或建议, 内容如下:\n"; $content .= "----------------------------------------------------------------------------\n"; $content .= $suggestion."\n\n"; $content .= "电话: $tel\n"; $content .= "E-Mail: $email\n"; $content .= "姓名: $name\n"; $content .= "----------------------------------------------------------------------------\n"; $content .= XDateTime::now()->toString(); $userId = $request->userid; $result = UserClient::getInstance()->addUserAdvice('意见建议', $content, $userId); $this->message("信息发送成功, 感谢您对好大夫网站的支持!", $response); return false; }/*}}}*/
public function doSuggestion($request, $response) {/*{{{*/ $suggestion = iconv("utf8", "gbk", $request->suggestion); $contactInfo = iconv("utf8", "gbk", $request->contactInfo); if ($suggestion == '' || $suggestion == '请填写您在使用中遇到的问题(目前暂时不提供疾病咨询服务)') { echo '{"res":"failure", "msg":"请填写您在使用中遇到的问题!"}'; return self::DIRECT_OUTPUT; } if ($contactInfo == '' || $contactInfo == '手机或邮箱') { echo '{"res":"failure", "msg":"请填写您的联系方式!"}'; return self::DIRECT_OUTPUT; } $from = $request->from; $content = "来自 ".$from." 的用户(触屏版)发送了一条意见或建议, 内容如下:\n"; $content .= "----------------------------------------------------------------------------\n"; $content .= $suggestion."\n\n"; $content .= "联系方式: $contactInfo\n"; $content .= "----------------------------------------------------------------------------\n"; $content .= XDateTime::now()->toString(); $userId = 0; $result = UserClient::getInstance()->addUserAdvice('意见建议', $content, $userId); if ($result) { echo '{"res":"success"}'; } else { echo '{"res":"failure", "msg":"对不起,信息提交失败!"}'; } return self::DIRECT_OUTPUT; }/*}}}*/
public function add($request, $response) { $diseaseId = $request->diseaseId; $params = $request->vars; $params['isVoteSelf'] = $request->isVoteSelf; if ($vars[threadCategoryId] < 0) { unset($vars[threadCategoryId]); } if (empty($diseaseId)) { $key = isset($params['key']) ? $params['key'] : ''; $name = isset($params['name']) ? $params['name'] : ''; $diseaseId = DiseaseClient::getInstance()->addDisease($key, $name, $params); } else { $diseaseId = DiseaseClient::getInstance()->modifyDisease($diseaseId, $params); $disease = DAL::get()->find('disease', $diseaseId); error_log($response->curOperatorUser->name . ' ' . XDateTime::now() . ' 修改疾病' . $disease->name . ' 的父疾病 为' . $params['parentName'] . "\n\n", 3, '/tmp/modifyparentdisease.log'); $re_symptom = $request->getRequest('re_symptom', ''); $re_search_word = $request->getRequest('re_search_word', ''); $re_location = $request->getRequest('re_location', ''); $stringList = array(DiseaseRelation::TYPE_SYMPTOM => $re_symptom, DiseaseRelation::TYPE_LOCATION => $re_location); DiseaseClient::getInstance()->updateStringRelation($disease->id, array_keys($stringList), $stringList); } $disease = DAL::get()->find('disease', $diseaseId); if ($disease->isNull() == false) { Squid::clean($disease->getUrl()); } $msg = urlencode('操作成功'); $response->setRedirect('/disease/detail?id=' . $diseaseId . '&msg=' . $msg); }
public function service($request, $response) {/*{{{*/ ob_start(); $result = $this->callCenterApi->responseCmdNone(); $function = $this->returnFunction($request); if(method_exists($this, $function)) { try { $lockName = $this->getLockerName($request); $cacher= DAL::get()->getCache(Cacher::CACHETYPE_LOCKER); $locker = LockUtil::factory(LockUtil::LOCK_TYPE_MEMCACHE, array('memcache' => $cacher)); $locker->getLock($lockName); $result = $this->$function($request,$response); $locker->releaseLock($lockName); } catch(LockException $ex) { $this->logTxt .= XDateTime::now()->toString()." 并发锁错误 $lockName\n"; } catch(Exception $ex) { $this->logTxt .= XDateTime::now()->toString()." 释放锁 $lockName\n"; $locker->releaseLock($lockName); } } echo $result; $this->logTxt .= XDateTime::now()->toString().'--->'.print_r($result, true)."\n"; header('Content-Length: ' . ob_get_length()); return parent::DIRECT_OUTPUT; }/*}}}*/
public function service($request, $response) {/*{{{*/ ob_start(); $result = ""; $function = $request->service; if(method_exists($this, $function)) { try { $lockName = $this->getLockerName($request); $cacher= DAL::get()->getCache(Cacher::CACHETYPE_LOCKER); $locker = LockUtil::factory(LockUtil::LOCK_TYPE_MEMCACHE, array('memcache' => $cacher)); $locker->getLock($lockName); $result = $this->$function($request,$response); $locker->releaseLock($lockName); } catch(LockException $ex) { $this->ioLogRecorder->addLog(XDateTime::now()->toString()."并发锁错误 $lockName\n"); } catch(Exception $ex) { $locker->releaseLock($lockName); } } echo $result; header('Content-Length: ' . ob_get_length()); return parent::DIRECT_OUTPUT; }/*}}}*/
/** * ajaxSaveLog * @brief 记录voip呼入呼出日志 * @author kxy * @version branches/v2.17.3 * @date 2013-11-19 */ public function ajaxSaveLog($request, $response) { /*{{{*/ $request->convertToGbk(); $logStr = XDateTime::now()->toString() . " 座席:" . $this->curOperator->workId . "\n" . print_r($request->voipLog, true) . "\n"; error_log($logStr, 3, $this->getLogFileName()); return parent::DIRECT_OUTPUT; }
public function modifyDotimePost($request, $response) { /*{{{*/ $projectInterviewId = $request->projectInterviewId; $projectInterview = DAL::get()->find('ProjectInterview', $projectInterviewId); DBC::requireTrue($projectInterview instanceof ProjectInterview, "ProjectInterview {$projectInterviewId} 不存在"); ProjectInterviewClient::getInstance()->modifyDotime($projectInterviewId, XDateTime::now()); $preMsg = "启动本次访视"; $response->setRedirect("/projectanswersheetmgr/listofprojectinterview?projectInterviewId=" . $projectInterviewId . "&preMsg=" . $preMsg); }
public function doAddTelOrderTask($request,$response) {/*{{{*/ DBC::requireNotEmptyString($request->spaceId, 'spaceId 不能为空'); DBC::requireNotEmptyString($request->taskType, 'taskType 不能为空'); DBC::requireNotEmptyString($request->taskRemark, 'taskRemark 不能为空'); DBC::requireNotEmptyString($request->executeGroup, 'executeGroup 不能为空'); $orderId = $request->orderId ? $request->orderId : 0; $taskBeginTime = XDateTime::valueOf($request->taskBeginTime); $taskBeginTime = $taskBeginTime->before(XDateTime::now())?XDateTime::now()->toString() : $request->taskBeginTime; $taskId = TelOrderTaskClient::getInstance()->addTelOrderTask($request->priority, $this->curUser, $request->spaceId, $request->taskType, $this->curUser, $request->executeGroup, $taskBeginTime, $orderId, 0, $request->taskRemark); $task = DAL::get()->find('TelOrderTask', $taskId); }/*}}}*/
public function log_trace() { if ($this->switch && in_array($this->debugerName, self::$debugerAry)) { try { throw new Exception(); } catch (Exception $ex) { $now = XDateTime::now(); $trace = $ex->getTraceAsString(); error_log("[{$now}]" . $trace . "\n", 3, "/home/{$this->debugerName}/logs/trace.log"); } } }
private function getData4Sitemap($urlList) {/*{{{*/ $content = ''; foreach($urlList as $url) { $content .= '<url> <loc>'.$url.'</loc> <lastmod>'.XDateTime::now()->toShortString().'</lastmod> <changefreq>daily</changefreq> <priority>0.4</priority> </url>'; } return $content; }/*}}}*/
private function checkOverTimeTickets() {/*{{{*/ $content = ''; $tickets = $this->getOverTimeTickets(); foreach ($tickets as $ticket) { $minutes = XDateTime::minuteDiff($ticket->utime, XDateTime::now()); if ($minutes > $this->maxBindTime) { $content .= $this->formatAlertContent($ticket, $minutes); } } $this->sendEmail($content); }/*}}}*/
public function confirmToVisit($request, $response) {/*{{{*/ $orderId = $request->id; $order = DAL::get()->find('BookingOrder', $orderId); //患者自己确认去就诊相当于患者电话确认 DBC::requireTrue(in_array($order->status, array(BookingOrder::STATUS_CONFIRM)), '当前状态不能领取加号凭证'); $now = XDateTime::now("Y-m-d H:i:s"); $before2Schedule = $order->schedule->addDay(-2)->setHour("20")->setMinute("00"); DBC::requireFalse($now < $before2Schedule, '当前状态不能领取加号凭证'); BookingClient::getInstance()->patientConfirmOrder($order->user,$orderId); $response->order = $order; }/*}}}*/
public static function transferSecurityInfo($data, $action, $key = '') {/*{{{*/ if (false == isset($data['_s'])) { $configs = BeanFinder::get('wapconfigs'); if(in_array($action, $configs->actions)) { return 202; } return $data; // return 205; } $s = array(); $s = self::getSecurityInfo($data['_s'], $key); if(false == isset($s['verify'])) { //return 205; } if(is_array($s)) { $data = array_merge($s,$data); } $base = self::transferData($data,$action, $key); if(false == ($base == $s['verify'])) { //return 205; } if(isset($s['requestTime'])) { $isOutTime = self::isOutTime($s['requestTime']); if($isOutTime) { error_log("[".XDateTime::now()."] ".$s['requestTime']."->>>".XDateTime::valueOfTime($s['requestTime'])." os:".$_REQUEST['os']." app:".$_REQUEST['app']." version:".$_REQUEST['v']."\n", 3, "/tmp/android_requesttimeout.log"); return 203; } } /*$isCrypt = self::prepareCryptConfigs($s, $action); if($isCrypt == false) { return 202; }*/ if (false == is_array($s)) return 124; foreach ($s as $k => $v) { $data[$k] = $v; } return $data; }/*}}}*/
public static function generateByDefaultKey($app, $captchaType, $charCnt, $clientIp, $effactiveTime) { /*{{{*/ DBC::requireTrue($effactiveTime < 60, "有效时间不能超过1小时"); $contentObj = ContentFactory::generate($captchaType); $contentArr = $contentObj->generate($charCnt); $handler = new QBase64(); $key = self::generateID(); $token = $handler->crypt(microtime() . $app . $key); $expireTime = XDateTime::now()->addMinute($effactiveTime)->getTime(); $originalValues = array('app' => $app, 'key' => $key, 'ip' => $clientIp, 'expiretime' => $expireTime, 'answer' => strtolower($contentArr['answer']), 'question' => $contentArr['question']); $cacher = Cacher::get()->getCache(Cacher::CACHETYPE_CAPTCHA); $cacher->add($token, $originalValues); return array('token' => $token, 'captchaId' => $key); }
public function receiveOld($request, $response) {/*{{{*/ $originalPost = file_get_contents("php://input"); $args = str_ireplace("args=", "", $originalPost, $times = 1); $logUrl = BeanFinder::get('configs')->smsReceiveLog; $args = trim(strip_tags($args)); $res = ''; if (false == empty($args)) { $res = SMSClient::getInstance()->receive($args); } echo $res; error_log(print_r($originalPost.' now='.XDateTime::now()."\n"."res:".$res."\n\n", true), 3, $logUrl); return parent::DIRECT_OUTPUT; }/*}}}*/
protected function getData($nowPage, $pageSize) {/*{{{*/ $rawDoctorUrlList = DAL::get()->queryAllDoctorUrl4wwwSitemap('doctor'); $doctorUrlArray = array(); foreach($rawDoctorUrlList as $url) { $tempUrlArray = array(); $tempUrlArray['loc'] = $url; $tempUrlArray['lastmod'] = XDateTime::now()->toShortString(); $tempUrlArray['changefreq'] = 'monthly'; $tempUrlArray['priority'] = 0.4; $doctorUrlArray[] = array('url' => $tempUrlArray); } unset($rawDoctorUrlList); return $doctorUrlArray; }/*}}}*/
protected function getData($nowPage, $pageSize) {/*{{{*/ $rawArticleList = DAL::get()->find_all_AllLastWeekOnLineArticle4wwwSitemap('article'); $articleUrlArray = array(); foreach($rawArticleList as $article) { $tempUrlArray = array(); $tempUrlArray['loc'] = $article->getUrl(); $tempUrlArray['lastmod'] = XDateTime::now()->toShortString(); $tempUrlArray['changefreq'] = 'weekly'; $tempUrlArray['priority'] = 0.4; $articleUrlArray[] = array('url' => $tempUrlArray); unset($article); } unset($rawArticleList); return $articleUrlArray; }/*}}}*/
protected function getData($nowPage, $pageSize) {/*{{{*/ $rawHospitalList = DAL::get()->find_all_AllHospital4wwwSitemap('hospital'); $hospitalUrlArray = array(); foreach($rawHospitalList as $hospital) { $tempUrlArray = array(); $tempUrlArray['loc'] = $hospital->getUrl(); $tempUrlArray['lastmod'] = XDateTime::now()->toShortString(); $tempUrlArray['changefreq'] = 'monthly'; $tempUrlArray['priority'] = 0.4; $hospitalUrlArray[] = array('url' => $tempUrlArray); unset($hospital); } unset($rawHospitalList); return $hospitalUrlArray; }/*}}}*/
protected function getData($nowPage, $pageSize) {/*{{{*/ $rawPaperDetailList = DAL::get()->find_all_AllPaper4wwwSitemap('paper'); $paperDetailUrlArray = array(); foreach($rawPaperDetailList as $paper) { $tempUrlArray = array(); $tempUrlArray['loc'] = $paper->getUrl(); $tempUrlArray['lastmod'] = XDateTime::now()->toShortString(); $tempUrlArray['changefreq'] = 'weekly'; $tempUrlArray['priority'] = 0.4; $paperDetailUrlArray[] = array('url' => $tempUrlArray); unset($paper); } unset($rawPaperDetailList); return $paperDetailUrlArray; }/*}}}*/
protected function getData($nowPage, $pageSize) {/*{{{*/ $rawFlowList = DAL::get()->find_all_AllLastWeekFlow4wwwSitemap('doctorpatientref', $nowPage, $pageSize); $flowUrlArray = array(); foreach($rawFlowList as $flow) { $tempUrlArray = array(); $tempUrlArray['loc'] = $flow->getUrl(); $tempUrlArray['lastmod'] = XDateTime::now()->toShortString(); $tempUrlArray['changefreq'] = 'weekly'; $tempUrlArray['priority'] = 0.4; $flowUrlArray[] = array('url' => $tempUrlArray); unset($flow); } unset($rawFlowList); BeanFinder::get('LocalCache')->removeAll(); return $flowUrlArray; }/*}}}*/
public function add($request, $response) { /*{{{*/ if (false == $request->id) { $noteTitle = $request->noteTitle; $creatorId = $request->userId; $creatorName = $request->userName; $noteType = $request->noteType; $noteContent = $request->noteContent; $noteRemark = $request->noteRemark; $id = DoctorClient::getInstance()->addNoteBook($noteTitle, $creatorId, $creatorName, $noteType, $noteContent, $noteRemark); } else { $params = array('id' => $request->id, 'noteTitle' => $request->noteTitle, 'modifierId' => $request->userId, 'modifierName' => $request->userName, 'noteType' => $request->noteType, 'noteContent' => $request->noteContent, 'noteRemark' => $request->noteRemark, 'noteModifyTime' => XDateTime::now()); $id = $request->id; DoctorClient::getInstance()->modifyNoteBook($id, $params); } $msg = "²Ù×÷³É¹¦ÁË£¡"; $response->setRedirect('/notebook/showadd?id=' . $id . '&msg=' . urlencode($msg)); }
public function check400TelConference($request, $response) {/*{{{*/ DBC::requireTrue(false == empty($_SERVER['HTTP_REFERER']), "无效的请求"); $confResultStr = ""; $confProcessArr = array(); $orderId = $request->orderid; $teleconf = Teleconference:: getValidTeleconf($orderId); if ($teleconf->isNull()) { $confResultStr = XDateTime::now()->toString()."---会议室尚未建立"; } else { $confResultStr = $teleconf->ctime->toString()."---会议室[$teleconf->id] 建立成功,下面是详情"; $confProcessArr = $teleconf->getConfCmdInfo(); } $response->confResultStr = $confResultStr; $response->confProcessArr = $confProcessArr; }/*}}}*/
public function validate() { $msg = ''; $dateTime = XDateTime::now()->addMinute(-5); $beginMonitorDateTime = $dateTime->setHour(8)->setMinute(0)->setSecond(0); $endMonitorDateTime = $dateTime->setHour(23)->setMinute(0)->setSecond(0); if ($dateTime->after($beginMonitorDateTime) && $dateTime->before($endMonitorDateTime)) { $heartbeats1 = array(); $heartbeats2 = array(); for ($i = 0; $i < 5; $i++) { $dateTimeStr = $dateTime->addMinute($i)->toStringByFormat('Y-m-d H:i'); exec("ssh 192.168.1.55 cat /home/avatar/logs/webapps/paymentfront/sms_remit.log | grep '$dateTimeStr' > /tmp/sms_remit.log"); $logStr = file_get_contents('/tmp/sms_remit.log'); exec("ssh 192.168.1.56 cat /home/avatar/logs/webapps/paymentfront/sms_remit.log | grep '$dateTimeStr' > /tmp/sms_remit.log"); $logStr .= file_get_contents('/tmp/sms_remit.log'); if (false !== strpos($logStr, 'device_xm')) { $heartbeats1[] = 1; } if (false !== strpos($logStr, 'device_hw')) { $heartbeats2[] = 1; } } $msg = ''; if (empty($heartbeats1)) { $msg = '['.$dateTime->toStringByFormat('Y-m-d H:i')."至".$dateTime->addMinute(5)->toStringByFormat('Y-m-d H:i').'] device_xm没有收到电话订单落实汇款短信短信小程序心跳请求'; } if (empty($heartbeats2)) { $msg .= '['.$dateTime->toStringByFormat('Y-m-d H:i')."至".$dateTime->addMinute(5)->toStringByFormat('Y-m-d H:i').'] device_hw没有收到电话订单落实汇款短信短信小程序心跳请求'; } if (false == empty($msg)) { //给whd & yyp & wk SMSClient::getInstance()->sendSMS(array(18612032258, 13691343423, 13720084864), $msg); } } return ''; }
/** * newPatientCase * 创建病历头 * @param mixed $doctorOwnerId 必填 * @param mixed $name * @param mixed $age * @param mixed $sex * @param mixed $address * @param mixed $phone * @param mixed $$province * @param mixed $city * @param mixed $src * @param mixed $medicalCard * @param mixed $personIdCard * @param mixed $patientIdCard * @param mixed $mark * @param mixed $attachmentids * @param mixed $groupId * @param mixed $isAttention 0 未关注 1 重点关注 * @access public * @return void */ public function newPatientCase($userId, $caseSummary, $clientCreateTime, $clientUpdateTime, $clientId, $name, $age, $sex, $address, $phone, $province, $city, $src, $medicalCard, $personIdCard, $patientIdCard, $mark, $diagnose, $attachmentIds, $groupId, $isAttention, $patientCaseId) {/*{{{*/ if(empty($clientId)) { return 0; } $doctorOwner = DAL::get()->find_by_userid('DoctorOwner',$userId); if($doctorOwner->isNull()) { return 0; } if (false == empty($patientCaseId)) { $oldPatientCase = DAL::get()->find('PatientCase', $patientCaseId); } $oldPatientCase = (false == isset($oldPatientCase) || $oldPatientCase->isNull()) ? PatientCase::getCaseByOwnerAndCaseSummary($doctorOwner->id, $caseSummary) : $oldPatientCase; if($oldPatientCase->isNull()) { $patientCaseId = PatientCourseClient::getInstance()->createPatientCaseWithAttach($doctorOwner, $caseSummary, $clientCreateTime, $clientUpdateTime, $name, $age, $sex, $address, $phone, $province, $city, $src, $medicalCard, $personIdCard, $patientIdCard, $mark, $diagnose, $attachmentIds); if($this->isOldVersion($_REQUEST['os'], $_REQUEST['v'])) { $this->newPatientCourseWithAllDetail($userId, $patientCaseId, 1, PatientCourse::TYPE_FIRST_MEDICAL, md5($patientCaseId.XDateTime::now()->toString()), XDateTime::now(), '', array()); } } else { $patientCaseId = $oldPatientCase->id; PatientCourseClient::getInstance()->modifyPatientCaseClientUpdateTime($patientCaseId, $clientUpdateTime); } $patientCase = DAL::get()->find('patientCase', $patientCaseId); $group = DAL::get()->find('regroup', $groupId); if($group->isNull()) { $unGroup = DAL::get()->find_by_doctorownerid_and_type('regroup', $doctorOwner->id, ReGroup::TYPE_2); $groupId = $unGroup->id; } if ($groupId > 0) { PatientClubClient::getInstance()->updateMember($doctorOwner->user->id, $patientCaseId, $groupId, ReGroupMember::MEMBER_PATIENT_TYPE_MYINPUT, $isAttention); } $this->content = array('clientId'=>$clientId, 'patientCaseId'=>$patientCase->id, 'ver'=>$patientCase->ver); }/*}}}*/
protected function getData($nowPage, $pageSize) {/*{{{*/ $baseUrl = 'http://www.'.URL_PREFIX.'haodf.com/sitemap/'; $fileBaseName = "sitemap_disease"; $diseaseList = DAL::get()->find_all_AllDisease4wwwSitemap('disease'); $diseaseCount = count($diseaseList); $fileList = array(); for($i=0; $i < ceil($diseaseCount/self::PAGESIZE); $i++) { $fileList[] = $fileBaseName.$i.'.xml'; } $diseaseIndexArray = array(); foreach($fileList as $fileName) { $tempIndexArray = array(); $tempIndexArray['loc'] = $baseUrl.$fileName; $tempIndexArray['lastmod'] = XDateTime::now()->toShortString(); $diseaseIndexArray[] = array('sitemap' => $tempIndexArray); } return $diseaseIndexArray; }/*}}}*/
protected function getData($nowPage, $pageSize) {/*{{{*/ $baseUrl = 'http://www.'.URL_PREFIX.'haodf.com/sitemap/'; $fileBaseName = "sitemap_flow"; $flowIdList = DAL::get()->find_id_AllLastWeekFlow4wwwSitemap('doctorpatientref'); $flowCount = count($flowIdList); unset($flowIdList); $fileList = array(); for($i=0; $i < ceil($flowCount/self::PAGESIZE); $i++) { $fileList[] = $fileBaseName.$i.'.xml'; } $flowIndexArray = array(); foreach($fileList as $fileName) { $tempIndexArray = array(); $tempIndexArray['loc'] = $baseUrl.$fileName; $tempIndexArray['lastmod'] = XDateTime::now()->toShortString(); $flowIndexArray[] = array('sitemap' => $tempIndexArray); } return $flowIndexArray; }/*}}}*/
public function run() {/*{{{*/ $msg = ''; echo "starting montors:\n"; foreach ($this->monitors as $monitorClass) { try { $monitor = new $monitorClass; echo "\tchecking ".$monitorClass." begin at ".XDateTime::now()."\n"; $msg .= $monitor->validate(); echo "\tchecking ".$monitorClass." end at ".XDateTime::now()."\n"; } catch (Exception $e) { $msg .= $monitorClass.' has an exception!'; echo "$monitorClass has an exception!\n"; } $monitor = null; } echo "ending montors.\n"; $this->sendMsg($msg); }/*}}}*/
public function queryVoip($request, $response) {/*{{{*/ $result = file_get_contents("php://input"); $this->logTxt .= XDateTime::now()->toString().'--->'."\n".print_r($result, true)."\n"; $requestContent = $this->IOConverter->output($result); $this->logTxt .= "\n".XDateTime::now()->toString().'--->'."\n".print_r($requestContent, true)."\n"; //IDеп╤о $id = $requestContent['id']; $strXML=""; $voipAccount = DAL::get()->find_by_userid('VoipAccount', $id); if(false == $voipAccount->isNull()) { $strXML="<?xml version='1.0' encoding='utf-8'?> <Response> <dname>$voipAccount->userid</dname> <voipid>$voipAccount->voipAccount</voipid> <voippwd>$voipAccount->voipPwd</voippwd> <hash>$id</hash> </Response>"; } $this->logTxt .= XDateTime::now()->toString().'--->'."\n".print_r($strXML, true)."\n"; echo $strXML; }/*}}}*/
public function ajaxGetNextRecommendThread($request, $response) {/*{{{*/ header('Content-Type: application/json; charset=UTF-8'); //判断是否推送的判断变量 $isCanAutoPull = (false === empty($_COOKIE["userinfo"]["hosttype"]) && 'Doctor' == $_COOKIE["userinfo"]['hosttype']) ; $cookie = new HdfCookie(); $isSuccess = 0; if($isCanAutoPull && (false === isset($_COOKIE['firstlogintime']) || (false == empty($_COOKIE['firstlogintime']) && (XDateTime::hourDiff(XDateTime::valueOf($_COOKIE['firstlogintime']), XDateTime::now()) > 24)))) { $auto = ThreadClient::getInstance()->autoPullRecommendThreads($this->_newUser); if ($auto) { $cookie->set("firstlogintime", XDateTime::now(), 7*24*3600); SpaceExpClient::getInstance()->createSpaceExp($this->_newUser->id, XDateTime::now()); $isSuccess = 1; } } $unUnreadCaseCount = FlowClient::getInstance()->getUnReadCount($this->_newSpace->id); $callback = $request->callback; echo "\n".$callback.'('; echo Json::encode($unUnreadCaseCount); echo ');'; //方便测试 echo "\nisCanAuto:".$isCanAutoPull; echo "\nisSuccess:".$isSuccess; exit; }/*}}}*/