Added $wgDataCenterId/$wgDataCenterRoles
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index 6fbc11d..3b9a882 100644 (file)
@@ -3605,6 +3605,28 @@ function wfSplitWikiID( $wiki ) {
        return $bits;
 }
 
+/**
+ * @see $wgDataCenterRoles
+ * @return string The current cluster ID
+ * @since 1.27
+ */
+function wfDataCenter() {
+       global $wgDataCenterId;
+
+       return $wgDataCenterId;
+}
+
+/**
+ * @see $wgDataCenterRoles
+ * @return string The current cluster role; one of (master/slave)
+ * @since 1.27
+ */
+function wfDataCenterRole() {
+       global $wgDataCenterId, $wgDataCenterRoles;
+
+       return $wgDataCenterRoles[$wgDataCenterId];
+}
+
 /**
  * Get a Database object.
  *