Get the Member associated with the current URL segment.

@return null|Member
481829
public function getCurrentProfile()
    {
        $urlSegment = $this->request->param('URLSegment');
        if ($urlSegment) {
            $filter = URLSegmentFilter::create();
            // url encode unless it's multibyte (already pre-encoded in the database)
            // see https://github.com/silverstripe/silverstripe-cms/pull/2384
            if (!$filter->getAllowMultibyte()) {
                $urlSegment = rawurlencode($urlSegment);
            }

            return Member::get()
                ->filter('URLSegment', $urlSegment)
                ->first();
        }

        return null;
    }
241640
public function getImageUrl()
    {
        if(array_key_exists(self::ITEM_IMAGE_URL, $this->_itemData)) {
            return (string) $this->_itemData[self::ITEM_IMAGE_URL];
        }
        return null;
    }
673295
public function getReferrer()
    {
        if (isset($this->_referrer)) {
            return $this->_referrer;
        }
        return $this->_referrer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
    }
1135323
public function url()
    {
        if ($this->urlName)
            return $this->urlName;
        if ($this->objectClass)
            return $this->objectClass->url($this);
        return null;
    }
384167
public function getCurrentCategory()
    {
        /**
         * @var Blog $dataRecord
         */
        $dataRecord = $this->dataRecord;
        $category = $this->request->param('Category');
        if ($category) {
            $filter = URLSegmentFilter::create();
            // url encode unless it's multibyte (already pre-encoded in the database)
            // see https://github.com/silverstripe/silverstripe-cms/pull/2384
            if (!$filter->getAllowMultibyte()) {
                $category = rawurlencode($category);
            }

            return $dataRecord->Categories()
                ->filter('URLSegment', $category)
                ->first();
        }
        return null;
    }
791355
public function getStageURLSegment()
    {
        /** @var SiteTree $stageRecord */
        $stageRecord = Versioned::get_one_by_stage(self::class, Versioned::DRAFT, [
            '"SiteTree"."ID"' => $this->ID
        ]);
        return ($stageRecord) ? $stageRecord->URLSegment : null;
    }
56289
public function getUrlPath()
    {
        $sUri = $this->getServerParam('REQUEST_URI', \FILTER_SANITIZE_URL);
        if (!is_null($sUri)) {
            return parse_url($sUri, \PHP_URL_PATH);
        }
        return null;
    }
932181
public function current()
    {
        list($name, $content) = $this->members[$this->pointer];
        if (is_a($content, ViewHelperInterface::class)) {
            /** @var $content ViewHelperInterface */
            return $content->__toString();
        }
        switch ($name) {
            case 'charset':
                return "<meta {$name}=\"{$content}\">";
            case 'base':
                return "<base href=\"{$content}\" />";
            default:
                return "<meta name=\"{$name}\" content=\"{$content}\">";
        }
    }
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;
    }
1166109
public function getBackURL()
    {
        $request = $this->getRequest();
        if (!$request) {
            return null;
        }
        $backURL = $request->requestVar('BackURL');
        // Fall back to X-Backurl header
        if (!$backURL && $request->isAjax() && $request->getHeader('X-Backurl')) {
            $backURL = $request->getHeader('X-Backurl');
        }
        if (!$backURL) {
            return null;
        }
        if (Director::is_site_url($backURL)) {
            return $backURL;
        }
        return null;
    }
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;
        }
    }
1168528
public function getUrl()
    {
        // Ensure in request cycle (even for override).
        if ($this->request === null) {
            return null;
        }

        // Ensure request has been matched
        if (!$this->request->attributes->get('_route')) {
            return null;
        }

        if ($this->override) {
            $this->resolveCurrentOverride();

            return (string) $this->override;
        }

        return $this->urlGenerator->generate(
            $this->request->attributes->get('_route'),
            $this->request->attributes->get('_route_params'),
            UrlGeneratorInterface::ABSOLUTE_URL
        );
    }
722780
protected function getCurrentUri() {
    $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'
      ? 'https://'
      : 'http://';
    $current_uri = $protocol . $_SERVER['HTTP_HOST'] . $this->getRequestUri();
    $parts = parse_url($current_uri);

    $query = '';
    if (!empty($parts['query'])) {
      $params = array();
      parse_str($parts['query'], $params);
      $params = array_filter($params);
      if (!empty($params)) {
        $query = '?' . http_build_query($params, NULL, '&');
      }
    }

    // Use port if non default.
    $port = isset($parts['port']) &&
      (($protocol === 'http://' && $parts['port'] !== 80) || ($protocol === 'https://' && $parts['port'] !== 443))
      ? ':' . $parts['port'] : '';

    // Rebuild.
    return $protocol . $parts['host'] . $port . $parts['path'] . $query;
  }
9237
public static function getCurrentSection()
    {
        static $lang;
        if (!isset($lang)) {
            $c = Page::getCurrentPage();
            if ($c instanceof Page) {
                $lang = self::getBySectionOfSite($c);
            }
        }

        return $lang;
    }
211315
private function getCurrentUrlPath()
    {
        if ($this->path) {
            return $this->path;
        }

        /**
         * check if the path is empty otherwise
         * set it with the server variable and if there's no server variable set it as the default delimiter [/] the root
         */
        $this->path = !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : null;
        $this->urlPart = $this->parsePath($this->path);

        return $this->path;
    }
838842
public function getCurrentOrganizationId()
    {
        $userLoader = $this->loader->getUserLoader();

        if ($this->getElement($this->organizationFieldName) instanceof \Zend_Form_Element_Hidden) {
            // Url determines organization first when there is only one organization
            // and thus the element is of class hidden
            if ($orgId = $userLoader->getOrganizationIdByUrl()) {
                $this->_organizationFromUrl = true;
                $userLoader->getCurrentUser()->setCurrentOrganization($orgId);
                return $orgId;
            }
        }

        $request = $this->getRequest();
        if ($request->isPost() && ($orgId = $request->getParam($this->organizationFieldName))) {
            return $orgId;
        }

        $curOrg = $userLoader->getCurrentUser()->getCurrentOrganizationId();
        $orgs   = $this->getChildOrganizations($this->getCurrentTopOrganizationId());
        if (isset($orgs[$curOrg])) {
            return $curOrg;
        }

        $orgIds = array_keys($orgs);
        $firstId = reset($orgIds);
        return $firstId;
    }
1219899
public function getCurrentUser()
    {
        $returnValue = null;

    	if(!common_session_SessionManager::isAnonymous()){
        	$userUri = \common_session_SessionManager::getSession()->getUser()->getIdentifier();
			if(!empty($userUri)){
        		$returnValue = new core_kernel_classes_Resource($userUri);
			} else {
				common_Logger::d('no userUri');
			}
    	}

        return $returnValue;
    }