Fragen\GitHub_Updater\GitHub_API::get_remote_changes PHP Метод

get_remote_changes() публичный Метод

Read the remote CHANGES.md file.
public get_remote_changes ( $changes ) : boolean
$changes
Результат boolean
    public function get_remote_changes($changes)
    {
        $response = isset($this->response['changes']) ? $this->response['changes'] : false;
        /*
         * Set response from local file if no update available.
         */
        if (!$response && !$this->can_update($this->type)) {
            $response = array();
            $content = $this->get_local_info($this->type, $changes);
            if ($content) {
                $response['changes'] = $content;
                $this->set_transient('changes', $response);
            } else {
                $response = false;
            }
        }
        if (!$response) {
            $response = $this->api('/repos/:owner/:repo/contents/' . $changes);
            if ($response) {
                $response = $this->parse_changelog_response($response);
                $this->set_transient('changes', $response);
            }
        }
        if ($this->validate_response($response)) {
            return false;
        }
        $parser = new \Parsedown();
        $changelog = $parser->text(base64_decode($response['changes']));
        $this->type->sections['changelog'] = $changelog;
        return true;
    }