Prepare 0.6.0
[shpub.git] / src / shpub / Config / Host.php
index 5dd23ddf0b7b316fe8aa4dd2eff592a2c7edc80b..f3214e29f8aea0da558b15d4ea2c074bd5798189 100644 (file)
@@ -37,5 +37,23 @@ class Config_Host
      * @var boolean
      */
     public $default;
+
+    public function __construct()
+    {
+        $this->endpoints = new Config_Endpoints();
+    }
+
+    public function loadEndpoints()
+    {
+        $this->endpoints = new Config_Endpoints();
+        $this->endpoints->load($this->server);
+        if ($this->endpoints->incomplete()) {
+            $this->endpoints->discover($this->server);
+            if ($this->token) {
+                $this->endpoints->discoverMedia($this->token);
+            }
+            $this->endpoints->save($this->server);
+        }
+    }
 }
 ?>