Пример #1
0
 /**
  * Updates the nonce value.
  *
  * @param string $nonce
  */
 protected function writeNonceValue(BBUserToken $token)
 {
     $now = strtotime($token->getCreated());
     $nonce = $token->getNonce();
     $signature_generator = new RequestSignatureEncoder();
     $signature = $signature_generator->createSignature($token);
     if (null === $this->registryRepository) {
         file_put_contents($this->nonceDir . DIRECTORY_SEPARATOR . $nonce, "{$now};{$signature}");
     } else {
         $registry = $this->getRegistry($nonce)->setValue("{$now};{$signature}");
         $this->registryRepository->save($registry);
     }
 }