示例#1
0
 /**
  * @return array
  * @throws HTTPException
  * @throws \Exception
  */
 public function getReplicationLog()
 {
     $sourceLog = null;
     $targetLog = null;
     $replicationDocId = '_local' . '/' . $this->task->getRepId();
     $sourceResponse = $this->source->findDocument($replicationDocId);
     $targetResponse = $this->target->findDocument($replicationDocId);
     if ($sourceResponse->status == 200) {
         $sourceLog = $sourceResponse->body;
     } elseif ($sourceResponse->status != 404) {
         throw HTTPException::fromResponse('/' . $this->source->getDatabase() . '/' . $replicationDocId, $sourceResponse);
     }
     if ($targetResponse->status == 200) {
         $targetLog = $targetResponse->body;
     } elseif ($targetResponse->status != 404) {
         throw HTTPException::fromResponse('/' . $this->target->getDatabase() . '/' . $replicationDocId, $targetResponse);
     }
     return array($sourceLog, $targetLog);
 }