Ejemplo n.º 1
0
 /**
  * This will save the access story to the database
  */
 public function saveStory()
 {
     // set the end time
     $this->getSessionManager()->setEndTime();
     // calculate the memory usage
     $this->getSessionManager()->setMemoryUsage();
     // get the collected data
     $aData = $this->getSessionManager()->getCollectedData();
     $aData = array_merge($aData, ['response_time' => $this->getSessionManager()->getTimeTaken(), 'memory_usage' => $this->getSessionManager()->getMemoryUsage()]);
     // save the access history now
     AccessStoryModel::create($aData);
     // remove the session, so that it would always be unique across each request
     \Session::remove(Reader::getSessionKeyName());
 }
Ejemplo n.º 2
0
 /**
  * @param null|SessionManager $oSessionManager
  */
 public function setSessionManager($oSessionManager)
 {
     $this->oSessionManager = $oSessionManager;
     // save it to the session here
     \Session::flash(Reader::getSessionKeyName(), $oSessionManager);
 }