diff --git a/system/src/Grav/Common/GPM/Remote/Grav.php b/system/src/Grav/Common/GPM/Remote/Grav.php new file mode 100644 index 000000000..7a0eb932a --- /dev/null +++ b/system/src/Grav/Common/GPM/Remote/Grav.php @@ -0,0 +1,55 @@ +repository); + + $this->fetch($refresh, $callback); + $this->data = json_decode($this->raw); + + $this->version = @$this->data->version ?: '-'; + $this->date = @$this->data->date ?: '-'; + + $this->data = $this->data->assets; + + foreach ($this->data as $slug => $data) { + $this->items[$slug] = new Package($data); + } + } + + /** + * Returns the list of assets associated to the latest version of Grav + * @return array list of assets + */ + public function getAssets() + { + return $this->data; + } + + /** + * Returns the latest version of Grav available remotely + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Return the release date of the latest Grav + * @return string + */ + public function getDate() + { + return $this->date; + } +}