Merge "Remove PHP detection from entry points other than index.php"
[lhc/web/wiklou.git] / includes / db / DatabaseMysqlBase.php
index 907cdbf..4f93419 100644 (file)
@@ -1354,6 +1354,21 @@ class MySQLMasterPos implements DBMasterPos {
                $this->asOfTime = microtime( true );
        }
 
+       function asOfTime() {
+               return $this->asOfTime;
+       }
+
+       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 );
+       }
+
        function __toString() {
                // e.g db1034-bin.000976/843431247
                return "{$this->file}/{$this->pos}";
@@ -1370,15 +1385,4 @@ class MySQLMasterPos implements DBMasterPos {
 
                return false;
        }
-
-       function hasReached( MySQLMasterPos $pos ) {
-               $thisPos = $this->getCoordinates();
-               $thatPos = $pos->getCoordinates();
-
-               return ( $thisPos && $thatPos && $thisPos >= $thatPos );
-       }
-
-       function asOfTime() {
-               return $this->asOfTime;
-       }
 }