Exemple #1
0
 /**
  * Sets the last_active timestamp and saves the session.
  *     $session->write();
  * [!!] Any errors that occur during session writing will be logged,
  * but not displayed, because sessions are written after output has
  * been sent.
  *
  * @return  boolean
  */
 public function write()
 {
     if (headers_sent() || $this->_destroyed) {
         // Session cannot be written when the headers are sent or when
         // the session has been destroyed
         return false;
     }
     // Set the last active timestamp
     $this->_data['last_active'] = time();
     try {
         return $this->_write();
     } catch (Exception $e) {
         Log::error(BaseException::text($e));
         return false;
     }
 }
Exemple #2
0
 /**
  * 获取当前异常的输出
  */
 public function getResponse()
 {
     return BaseException::response($this);
 }
Exemple #3
0
 /**
  * @param Validation $array   Validation对象
  * @param string     $message 错误信息
  * @param array      $values  翻译变量
  * @param int        $code    异常代码
  * @param Exception  $previous
  */
 public function __construct(Validation $array, $message = 'Failed to validate array', array $values = null, $code = 0, Exception $previous = null)
 {
     $this->array = $array;
     parent::__construct($message, $values, $code, $previous);
 }