예제 #1
0
 /**
  * (non-PHPdoc)
  * @see ContentEngine\Filter\Serialise.SerialisationAlgorithmInterface::serialise()
  */
 public function serialise($data)
 {
     $serial = $this->serialiser->serialise($data);
     if (isset($this->compressor)) {
         $serial = $this->compressor->compress($serial);
     }
     if (isset($this->encryptor)) {
         $serial = $this->encryptor->encrypt($serial);
     }
     return $serial;
 }
예제 #2
0
 /**
  * (non-PHPdoc)
  * @see ContentEngine\Request.QueueInterface::push()
  */
 public function push(ItemCollection $collection)
 {
     if (!isset($this->exchange)) {
         throw new \Exception('No AMQP exchange set.');
     }
     $serial = $this->serialiser->serialise($collection);
     $this->exchange->publish($serial, $this->routingKey);
     return true;
 }