コード例 #1
0
ファイル: MySQLMasterPos.php プロジェクト: paladox/mediawiki
 function channelsMatch(DBMasterPos $pos)
 {
     if (!$pos instanceof self) {
         throw new InvalidArgumentException("Position not an instance of " . __CLASS__);
     }
     // Prefer GTID comparisons, which work with multi-tier replication
     $thisPosDomains = array_keys($this->getGtidCoordinates());
     $thatPosDomains = array_keys($pos->getGtidCoordinates());
     if ($thisPosDomains && $thatPosDomains) {
         // Check that this has GTIDs for all domains in $pos
         return !array_diff($thatPosDomains, $thisPosDomains);
     }
     // Fallback to the binlog file comparisons
     $thisBinPos = $this->getBinlogCoordinates();
     $thatBinPos = $pos->getBinlogCoordinates();
     return $thisBinPos && $thatBinPos && $thisBinPos['binlog'] === $thatBinPos['binlog'];
 }
コード例 #2
0
ファイル: DatabaseMysqlBase.php プロジェクト: sftsk/mediawiki
 function hasReached(DBMasterPos $pos)
 {
     if (!$pos instanceof self) {
         throw new InvalidArgumentException("Position not an instance of " . __CLASS__);
     }
     $thisPos = $this->getCoordinates();
     $thatPos = $pos->getCoordinates();
     return $thisPos && $thatPos && $thisPos >= $thatPos;
 }
コード例 #3
0
 function channelsMatch(DBMasterPos $pos)
 {
     if (!$pos instanceof self) {
         throw new InvalidArgumentException("Position not an instance of " . __CLASS__);
     }
     $thisBinlog = $this->getBinlogName();
     $thatBinlog = $pos->getBinlogName();
     return $thisBinlog !== false && $thisBinlog === $thatBinlog;
 }