本文整理汇总了PHP中CakeTime::isTomorrow方法的典型用法代码示例。如果您正苦于以下问题:PHP CakeTime::isTomorrow方法的具体用法?PHP CakeTime::isTomorrow怎么用?PHP CakeTime::isTomorrow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CakeTime
的用法示例。
在下文中一共展示了CakeTime::isTomorrow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isTomorrow
/**
* Returns true if given datetime string is tomorrow.
*
* @param int|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
*
* @return bool True if datetime string was yesterday
* @see CakeTime::isTomorrow()
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
*/
public function isTomorrow($dateString, $timezone = NULL)
{
return $this->_engine->isTomorrow($dateString, $timezone);
}
示例2: analysis
//.........这里部分代码省略.........
$this->Session->setFlash("Your predictions are being processed, we will send you an email when the analysis finish", 'success');
return $this->redirect(array('controller' => 'Participants', 'action' => 'analysis'));
}
} else {
if (isset($this->request->data['Participant']['results_File']['size']) && $this->request->data['Participant']['results_File']['size'] > 0) {
if ($this->request->data['Participant']['results_File']['size'] > $this->filesize2bytes(Configure::read('max_file_size'))) {
$this->Session->setFlash("The file can not be more than " . Configure::read('max_file_size'));
return $this->redirect(array('controller' => 'Participants', 'action' => 'analysis'));
}
/* ============================================= */
/* =====================Results================= */
/* ============================================= */
$file = new File($this->request->data['Participant']['results_File']['tmp_name']);
if ($file->readable()) {
$content = $file->read();
$file->close();
$content = $this->decrypt($content);
$results = json_decode(trim($content), true);
// debug($results);
if (!empty($results)) {
$projects = $this->getParticipantProjects($email, $code, $results['project_id']);
if (!empty($projects)) {
$goldenSet = $this->Participant->GoldenProject->find('first', array('recursive' => -1, 'fields' => array('user_id', 'round_id'), 'conditions' => array('project_id' => $results['project_id'])));
if (!empty($goldenSet)) {
$isModified = !$this->Participant->PredictionFile->hasAny(array('participant_id' => $results['Participant']['id'], 'modified' => $results['date']));
$results['Participant']['isModified'] = $isModified;
$results['Golden']['user_id'] = $goldenSet['GoldenProject']['user_id'];
$results['Golden']['round_id'] = $goldenSet['GoldenProject']['round_id'];
$this->Session->write("analysisResults", $results);
$this->redirect(array('action' => 'results'));
} else {
$this->Session->setFlash("This golden set have been deleted");
}
} else {
$this->Session->setFlash("This file does not correspond to your credentials");
}
} else {
$this->Session->setFlash("This file is corrupted");
}
} else {
$this->Session->setFlash("This file is corrupted");
}
} else {
if (empty($projects)) {
$this->Session->setFlash("You are not in any project");
} else {
$this->Session->setFlash("One team prediction file or one result file is needed");
}
}
}
} else {
$cookie = $this->Cookie->read('participantData');
if (isset($cookie)) {
if (isset($cookie['email']) && $cookie['code']) {
$this->request->data['Participant']['email'] = $cookie['email'];
$this->request->data['Participant']['code'] = $cookie['code'];
$this->request->data['Participant']['remember_me'] = true;
if (isset($cookie['project_id'])) {
$this->request->data['Project']['Project'] = $cookie['project_id'];
}
$projects = $this->getParticipantProjects($cookie['email'], $cookie['code']);
if (empty($projects)) {
$this->Cookie->destroy('participantData');
}
} else {
$this->Cookie->destroy('participantData');
}
}
$this->loadModel('Post');
$this->Post->recursive = -1;
$this->Post->contain(false, array('User' => array('username', 'surname', 'full_name', 'image', 'image_type', 'id')));
$this->Post->paginate = array('limit' => 5, 'order' => array('modified' => 'DESC'));
$this->set("posts", $this->paginate($this->Post));
}
$this->set('projects', $projects);
App::uses('CakeTime', 'Utility');
$finalDate = Configure::read('final_date_to_upload_tasks');
$startDate = Configure::read('initial_date_to_upload_tasks');
$isEnd = CakeTime::isPast($finalDate);
$isFuture = CakeTime::isFuture($startDate);
$isThisWeek = CakeTime::isThisWeek($finalDate);
$isToday = CakeTime::isTomorrow(CakeTime::fromString($finalDate));
$finalDate = CakeTime::format($finalDate, "%B %e, %Y");
$startDate = CakeTime::format($startDate, "%B %e, %Y");
$this->set('isEnd', $isEnd);
$this->set('isFuture', $isFuture);
$this->set('isThisWeek', $isThisWeek);
$this->set('isToday', $isToday);
$this->set('finalDate', $finalDate);
$this->set('startDate', $startDate);
//// $key = "xVO5JLSLOTpKX4YRyFpJXNYb1STQK26mHAzgNK6bwS697XzK8ZE5kEA8R7gajaI9fE6HfemeLhg28nqbGTmh5Dv5uKydSOoM4BHlQ43mvH4h0Jl3xFDcv95fRnY9wYAluS1WFi9QOLc2JDUOsN3ggNzypHuZcPaAjBklfsNH98qkX5brqEnfMUubPOUCtpTEUmtvVNq2oTGKSArEuSuuKRnMHtlbKvl4XbaAUvSfajF4DtHwLa2qaWU6pNXLHf16";
//// $key = "FFF3454D1E9CCDE00101010101010101";
// $value = "63612bb6b56ef964bc2a6add5e0697deadde735fd4ca966d7b762f61b2b4cb14a14500";
//// $value = base64_decode($value);
//// debug($value);
//// $result = Security::rijndael($value, $key, 'decrypt');
// $result = $this->decrypt($value);
//// $resultE = Security::rijndael($value, $key, 'encrypt');
// $this->set(compact('result', 'resultE'));
}