App\Http\Controllers\UpdateController::getUpdateInfo PHP Method

getUpdateInfo() protected method

protected getUpdateInfo ( $key = null )
    protected function getUpdateInfo($key = null)
    {
        if (!$this->updateInfo) {
            // add timestamp to control cdn cache
            $url = $this->updateSource . "?v=" . substr(time(), 0, -3);
            try {
                $response = file_get_contents($url);
            } catch (\Exception $e) {
                Log::error("[CheckingUpdate] Failed to get update information: " . $e->getMessage());
            }
            if (isset($response)) {
                $this->updateInfo = json_decode($response, true);
            }
        }
        $this->latestVersion = Arr::get($this->updateInfo, 'latest_version', $this->currentVersion);
        if (!is_null($key)) {
            return Arr::get($this->updateInfo, $key);
        }
        return $this->updateInfo;
    }