瀏覽代碼

Add support for system stats endpoint.

Shane Mc Cormack 8 年之前
父節點
當前提交
75934fbdd5
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      src/MyDNSHostAPI.php

+ 12 - 0
src/MyDNSHostAPI.php

@@ -249,6 +249,18 @@
 			return isset($result['response'][$key]) ? $result['response'][$key] : NULL;
 			return isset($result['response'][$key]) ? $result['response'][$key] : NULL;
 		}
 		}
 
 
+		/**
+		 * Get system stats.
+		 *
+		 * @return Result from the API.
+		 */
+		public function getSystemStats($type, $options) {
+			if ($this->auth === FALSE) { return []; }
+
+			$result = $this->api('/system/stats/' . $type, 'GET', $options);
+			return isset($result['response']['stats']) ? $result['response']['stats'] : [];
+		}
+
 		/**
 		/**
 		 * Set information a given user id.
 		 * Set information a given user id.
 		 *
 		 *