예제 #1
0
 public function __destruct()
 {
     if ($this->sessionEncrypt) {
         $data = Encryption::encode(serialize($this->sessionData), $this->sessionKey);
     } else {
         $data = serialize($this->sessionData);
     }
     return write_file(MAIN_PATH . $this->sessionPath . $this->sessionId, $data);
 }
예제 #2
0
 /**
  * Store Cache
  *
  * @param string $flag
  * @param mixed  $data
  * @param int    $maxAge
  * @return bool
  */
 public function store($flag, $data, $maxAge = 60)
 {
     if ($this->cacheActive) {
         $cache = array('date_created' => time(), 'max_age' => $maxAge, 'data' => $data);
         if ($this->cacheEncrypt) {
             $cache = Encryption::encode(serialize($cache));
         } else {
             $cache = serialize($cache);
         }
         return write_file(MAIN_PATH . 'storage/cache/' . sha1($flag . ($this->cacheEncrypt ? '_encrypt' : '')), $cache);
     }
     return false;
 }
예제 #3
0
 public function encryption()
 {
     echo $cipher = Encryption::encode('Are you authorized to profile this page? Probe not found or invalid signature. This is the most common issue when installing the Blackfire stack. If this issue occurs, please follow these steps:');
     echo nl2br(PHP_EOL) . nl2br(PHP_EOL);
     echo Encryption::decode($cipher);
 }