Return current page's URL.

@author Vova Feldman (@svovaf)
@since  1.0.7

@return string
433036
function current_page_url() {
            $url = 'http';

            if ( isset( $_SERVER["HTTPS"] ) ) {
                if ( $_SERVER["HTTPS"] == "on" ) {
                    $url .= "s";
                }
            }
            $url .= "://";
            if ( $_SERVER["SERVER_PORT"] != "80" ) {
                $url .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
            } else {
                $url .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
            }

            return esc_url( $url );
        }
983600
protected function getCurrentUrl()
    {
        $schema = ((!empty($this->server['HTTPS']) && $this->server['HTTPS'] !== 'off') || (!empty($this->server['SERVER_PORT']) && $this->server['SERVER_PORT'] == 443)) ? 'https://' : 'http://';

        $host = isset($this->server['HTTP_HOST']) ? $this->server['HTTP_HOST'] : 'localhost';

        return $schema.$host.$this->server['REQUEST_URI'];
    }
751107
public function url()
    {
        $dirname = $this->parent->url();

        if ($this->parent instanceof Root) { //at root

            return $dirname.$this->basename();
        }

        return sprintf('%s/%s', $dirname, $this->basename());

    }
216345
public function currentPage()
    {
        if (isset($this->pages[self::NEXT])) {
            $page = $this->pages[self::NEXT] - 1;
        } else {
            $page = $this->pages[self::PREV] + 1;
        }

        return $page;
    }
655684
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']));
        }
        $url->set_anchor('p'.$this->objectid);
        return $url;
    }
144085
public function getURL() {
		return $this->scheme.'://'.$this->domain.$this->path.($this->parameters ? '?'.http_build_query($this->parameters) : '');
	}
922344
public function getUrl()
    {
        $query = $this->getQueryString();
        return sprintf('%s://%s/%s/%s%s',
            $this->getScheme(),
            trim($this->getHost(), '/'),
            trim($this->config->getRootEndpoint(), '/'),
            $this->getEntityType(),
            empty($query) ? '' : sprintf('?%s', $query)
        );
    }
623192
public function getUrl()
    {
        if (!$this->isSortable()) {
            return '';
        }

        $params = ['sort_key' => $this->key];

        if ($this->isSortKey()) {
            $params['sort_order'] = $this->request->input('sort_order') == 'desc' ? 'asc' : 'desc';
        }

        return '?'.http_build_query($params + $this->request->all());
    }
497510
public static function getCurrentPath()
    {
        if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
            $url = $_SERVER['HTTP_X_REWRITE_URL'];
        } elseif (isset($_SERVER['REQUEST_URI'])) {
            $url = $_SERVER['REQUEST_URI'];
        } elseif (isset($_SERVER['ORIG_PATH_INFO'])) {
            $url = $_SERVER['ORIG_PATH_INFO'] . (!empty($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '');
        } else {
            $url = '';
        }

        return strpos($url, '?') ? strstr($url, '?', true) : $url;
    }
37595
public function getUrl() : ?string 
    {
        if ( ! $this->hasUrl()) {
            $this->setUrl($this->getDefaultUrl());
        }
        return $this->url;
    }
455800
public function getUrl()
    {
        if (empty($this->url)) {
            $url = $this->httpRequest()->getCurrentUrl(true)->getPath();
            // we need to have the trailing slash because of the match inside matchRequest
            // and also when matching the default method, we can do an incorrect match if we don't have the start and end slash
            $this->url = $this->str($url)->trimRight('/')->val() . '/';
        }

        return $this->url;
    }
950724
public static function getCurrentRoute()
    {
        $current = null;
        $request = Request::current();
        $routeStr = $request->getRouteStr();
        $method = $request->getMethod();

        //Search for the route
        foreach (self::$routes as $route) {
            //Check the method
            if (!in_array($method, $route['methods'])) {
                continue;
            }

            //Check number of slashes
            if (
                substr_count($route['route'], '/')
                != substr_count($routeStr, '/')
            ) {
                continue;
            }

            //Checks the route string
            if (
                ParametrizedString
                    ::make($route['route'])
                    ->matches($routeStr)
            ) {
                $current = $route;
                break;
            }
        }

        return $current;
    }
702783
public static function getCurrentUrlNoParam(){
		$url = self::getCurrentUrl();
		if(strstr($url,"#")){
			$url = substr($url,0,strpos($url,"#"));
		}
		
		if(strstr($url,"?")){
			$url = substr($url,0,strpos($url,"?"));
		}
		return $url;
		
	}
329627
protected function getRedirectUrl()
    {
        $url = $this->redirector->getUrlGenerator();

        if ($this->redirect) {
            return $url->to($this->redirect);
        } elseif ($this->redirectRoute) {
            return $url->route($this->redirectRoute);
        } elseif ($this->redirectAction) {
            return $url->action($this->redirectAction);
        }

        return $url->previous();
    }
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;
    }
1186794
public function current()
    {
        // Getting the first page
        if ($this->currentPage === null) {
            $data = $this->api->searchWithBody($this->body);
            if (isset($data['next_page_token'])) {
                $this->nextPage = $data['next_page_token'];
            }

            return $data;
        }

        // Getting another page
        $body = array_merge($this->body, ['pagetoken' => $this->currentPage]);
        $data = $this->api->searchWithBody($body);
        if (isset($data['next_page_token'])) {
            $this->nextPage = $data['next_page_token'];
        } else {
            $this->nextPage = null;
        }

        return $data;
    }
400561
private function getCurrentPath()
    {
        if (is_null($this->currentPath)) {
            $this->currentPath = $this->str($this->httpRequest()->getCurrentUrl(true)->getPath());
        }

        return $this->currentPath;
    }