Exemplo n.º 1
0
 /**
  * Call the failed method on the job instance.
  *
  * @param array $data
  */
 public function failed(array $data)
 {
     $command = unserialize($this->encrypter->decrypt(array_key_exists('command64', $data) ? $data['command64'] : $data['command']));
     if (method_exists($command, 'failed')) {
         $command->failed();
     }
 }
Exemplo n.º 2
0
 /**
  * Encrypt the cookies on an outgoing response.
  *
  * @param \Psr\Http\Message\ResponseInterface $response
  *
  * @return \Psr\Http\Message\ResponseInterface
  */
 protected function encrypt(ResponseInterface $response) : ResponseInterface
 {
     foreach ($response->headers->getCookies() as $cookie) {
         if ($this->isDisabled($cookie->getName())) {
             continue;
         }
         $response->headers->setCookie($this->duplicate($cookie, $this->encrypter->encrypt($cookie->getValue())));
     }
     return $response;
 }
Exemplo n.º 3
0
 /**
  * Write values to handler.
  */
 private function writeToHandler()
 {
     $values = $this->values;
     $values[self::METADATA_NAMESPACE] = ['firstTrace' => $this->firstTrace, 'lastTrace' => $this->lastTrace, 'regenerationTrace' => $this->regenerationTrace, 'requestsCount' => $this->requestsCount, 'fingerprint' => $this->fingerprint];
     $this->handler->write($this->id, $this->encrypter->encrypt(json_encode($values, \JSON_PRESERVE_ZERO_FRACTION)));
 }
Exemplo n.º 4
0
 /**
  * Run the Closure based queue job.
  *
  * @param \Viserio\Contracts\Queue\Job $job
  * @param array                        $data
  */
 public function run(JobContract $job, array $data)
 {
     $closure = unserialize($this->crypt->decrypt($data['closure']));
     $closure($job);
 }