Merge "Add ext-dom to composer.json"
[lhc/web/wiklou.git] / includes / libs / rdbms / database / position / MySQLMasterPos.php
index 38f2bd6..fa2c1db 100644 (file)
@@ -17,7 +17,7 @@ use UnexpectedValueException;
  * @see https://dev.mysql.com/doc/refman/5.6/en/replication-gtids-concepts.html
  */
 class MySQLMasterPos implements DBMasterPos {
-       /** @var int One of (BINARY_LOG, GTID_MYSQL, GTID_MARIA) */
+       /** @var string One of (BINARY_LOG, GTID_MYSQL, GTID_MARIA) */
        private $style;
        /** @var string|null Base name of all Binary Log files */
        private $binLog;
@@ -288,7 +288,13 @@ class MySQLMasterPos implements DBMasterPos {
        }
 
        public function serialize() {
-               return serialize( [ 'position' => $this->__toString(), 'asOfTime' => $this->asOfTime ] );
+               return serialize( [
+                       'position' => $this->__toString(),
+                       'activeDomain' => $this->activeDomain,
+                       'activeServerId' => $this->activeServerId,
+                       'activeServerUUID' => $this->activeServerUUID,
+                       'asOfTime' => $this->asOfTime
+               ] );
        }
 
        public function unserialize( $serialized ) {
@@ -298,6 +304,15 @@ class MySQLMasterPos implements DBMasterPos {
                }
 
                $this->init( $data['position'], $data['asOfTime'] );
+               if ( isset( $data['activeDomain'] ) ) {
+                       $this->setActiveDomain( $data['activeDomain'] );
+               }
+               if ( isset( $data['activeServerId'] ) ) {
+                       $this->setActiveOriginServerId( $data['activeServerId'] );
+               }
+               if ( isset( $data['activeServerUUID'] ) ) {
+                       $this->setActiveOriginServerUUID( $data['activeServerUUID'] );
+               }
        }
 
        /**