Get an URL that can be used to download the file.
This passes through the download_file single page.

@return \League\URL\URLInterface
342114
public function getDownloadURL()
    {
        $app = Application::getFacadeApplication();
        $urlResolver = $app->make(ResolverManagerInterface::class);
        $c = Page::getCurrentPage();
        $cID = $c instanceof Page && !$c->isError() ? $c->getCollectionID() : 0;

        return $urlResolver->resolve(['/download_file', $this->getFileID(), $cID]);
    }
1142494
public function getUrl()
	{
		$commentable = $this->commentable;

		$url = false;
		if (method_exists($commentable, 'getUrl'))
		{
			$url = $commentable->getUrl();
		}

		return \URL::to($url.'#C'.$this->id);
	}
297682
public function downloadAction()
    {
        if (null === $file = (new CmsFileQuery)->byObject($this->object, $this->objectId)
            ->findPk($this->id)) {
            return '';
        }
        $this->getResponse()->redirectToUrl($file->getUrl());
    }
1097978
public function getURL()
    {
        if (!isset($this->_url)) {
            $this->_url = 'option='.$this->component.'&view='.$this->_mixer->getIdentifier()->name;

            if ($this->_mixer->id) {
                $this->_url .= '&id='.$this->_mixer->id;
            }
        }

        return $this->_url;
    }
221800
public function downloadUrl(): string
    {
        return route('media-download', [
            'xref'    => $this->media->xref(),
            'ged'     => $this->media->tree()->name(),
            'fact_id' => $this->fact_id,
        ]);
    }
1359141
public function getURL()
    {
        if ($this->cPointerExternalLink != '') {
            $link = $this->cPointerExternalLink;
        } elseif ($this->cPath) {
            $link = $this->cPath;
        } elseif ($this->cID == Page::getHomePageID()) {
            $link = DIR_REL . '/';
        } else {
            $link = DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=' . $this->cID;
        }

        return $link;
    }
1270426
protected function downloadFile() {
		$content = @file_get_contents($this->url);
		if($content) {
			$this->tmp = \Yii::getAlias('@runtime' . DIRECTORY_SEPARATOR . md5($this->url) . '.' . pathinfo($this->url, PATHINFO_EXTENSION));
			file_put_contents($this->tmp, $content);
		}

		return $this->tmp;
	}
58063
public function getUrlAttribute()
    {
        if ($this->url === null) {
            $this->url = $this->makeUrl();
        }

        return $this->url;
    }
1344467
public function get_url() {
        if ($this->other['forumtype'] == 'single') {
            // Single discussion forums are an exception. We show
            // the forum itself since it only has one discussion
            // thread.
            $url = new \moodle_url('/mod/forum/view.php', array('f' => $this->other['forumid']));
        } else {
            $url = new \moodle_url('/mod/forum/discuss.php', array('d' => $this->other['discussionid']));
        }
        return $url;
    }
189138
public function getSLOurl()
    {
        $url = null;
        $idpData = $this->_settings->getIdPData();
        if (isset($idpData['singleLogoutService']) && isset($idpData['singleLogoutService']['url'])) {
            $url = $idpData['singleLogoutService']['url'];
        }
        return $url;
    }
581081
public function getDownloadUrl() {
		$url = Configs::get( 'api' ) . '/v1/plugins/' . $this->slug . '/download';

		$url = add_query_arg( 'key', Configs::get( 'key' ), $url );

		return $url;
	}
813917
public function download()
    {
        $download_path = parse_url($this->links['download_location'], PHP_URL_PATH);
        $download_query = parse_url($this->links['download_location'], PHP_URL_QUERY);
        $link = self::get($download_path . "?" . $download_query);
        $linkClass = \GuzzleHttp\json_decode($link->getBody());
        return $linkClass->url;
    }
940683
public function get_url() {
        global $CFG;

        // We keep compatibility with 2.7 and 2.8 other['coursesectionid'].
        $sectionnumber = null;
        if (isset($this->other['coursesectionnumber'])) {
            $sectionnumber = $this->other['coursesectionnumber'];
        } else if (isset($this->other['coursesectionid'])) {
            $sectionnumber = $this->other['coursesectionid'];
        }
        require_once($CFG->dirroot . '/course/lib.php');
        try {
            return course_get_url($this->courseid, $sectionnumber);
        } catch (\Exception $e) {
            return null;
        }
    }
15298
public static function pageURL() {
		$URL = "http";
		if(!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
			$URL .= "s";
		}
		$URL .= "://".$_SERVER["SERVER_NAME"];
		if($_SERVER["SERVER_PORT"] != "80") {
			$URL .= ":".$_SERVER["SERVER_PORT"];
		}
		$URL .= $_SERVER["REQUEST_URI"];
		return $URL;
	}
22183
public function getUrl()
    {
        if (!in_array($this->getMethod(), array(RequestInterface::METHOD_GET, RequestInterface::METHOD_HEAD))) {
            return $this->url;
        }

        $url = $this->url;

        if (count($this->data)) {

            $url .= false === strpos($url, '?') ? '?' : '&';
            $url .= http_build_query($this->data);
        }

        return $url;
    }
590453
public function getUrl() {
		
		$sefParams = array();
		$cgiParams = array();
		
		// queue all parameters
		foreach ($this->vars as $key=>$val) {
			if (is_int($key)) {
				$sefParams[] = $val;
			} else {
				$cgiParams[$key] = $val;
			}
		}

		$url = $this->module . '/' . $this->action;
		
		// add slashed params
		if (count($sefParams)) {
			$url .= '/' . implode('/', $sefParams);
		}

		// add ordering
		if ($this->order) {
			$url .= '/order-' . $this->order;
		}
		
		// add pagination
		if ($this->page) {
			$url .= '/page-' . $this->getPage();
		}
		
		// add associative params
		if (count($cgiParams)) {
			$url .= '?' . http_build_query($cgiParams);
		}

		return $url;
		
	}
193153
public function getURL()
    {
        $p = $this->recall('page');

        // If there is a login page, no need to return to it
        if ($p == 'login') {
            return $this->app->url('/');
        }

        $url = $this->app->url($p, $this->recall('args', null));
        $this->forget('page');
        $this->forget('args');

        return $url;
    }