本文整理汇总了PHP中XDateTime::now方法的典型用法代码示例。如果您正苦于以下问题:PHP XDateTime::now方法的具体用法?PHP XDateTime::now怎么用?PHP XDateTime::now使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XDateTime
的用法示例。
在下文中一共展示了XDateTime::now方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: soapServer
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;
}/*}}}*/
示例2: postSuggestion
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;
}/*}}}*/
示例3: doSuggestion
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;
}/*}}}*/
示例4: add
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);
}
示例5: service
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;
}/*}}}*/
示例6: service
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;
}/*}}}*/
示例7: ajaxSaveLog
/**
* 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;
}
示例8: modifyDotimePost
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);
}
示例9: doAddTelOrderTask
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);
}/*}}}*/
示例10: log_trace
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");
}
}
}
示例11: getData4Sitemap
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;
}/*}}}*/
示例12: checkOverTimeTickets
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);
}/*}}}*/
示例13: confirmToVisit
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;
}/*}}}*/
示例14: transferSecurityInfo
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;
}/*}}}*/
示例15: generateByDefaultKey
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);
}