@param string $currentUri

@return bool
350399
public function findActivePageByUri($currentUri)
    {
        $foundPages = [];
        $siteUrl = url()->current();

        $pages = $this->getPages();

        foreach ($pages as $page) {
            $url = $page->getUrl();
            $len = strpos($url, $siteUrl);
            if ($len !== false) {
                $len += strlen($siteUrl);
            }

            $url = substr($url, $len);

            $len = strpos($currentUri, $siteUrl);
            if ($len !== false) {
                $len += strlen($siteUrl);
            }

            if (! empty($url)) {
                $uri = substr($currentUri, $len);
                $pos = strpos($uri, $url);

                if ($pos !== false) {
                    $foundPages[strlen(substr($uri, strlen($url)))] = $page;
                    $page->setStatus(true);
                }
            }
        }

        if (count($foundPages) > 0) {
            ksort($foundPages);
            $page = array_shift($foundPages);
            $this->navigation->setCurrentPage($page);
        }

        foreach ($this->getSections() as $section) {
            $section->findActivePageByUri($currentUri);
        }
    }
397205
public function setCurrentAvatar(\Dacorp\ExtraBundle\Entity\DacorpMedia $currentAvatar = null)
    {
        $this->currentAvatar = $currentAvatar;

        return $this;
    }
516696
public function matches($requestUri)
    {
        $requestUri = $this->normalizeUri($requestUri);
        $regex = $this->compile();

        if (preg_match('#^'.$regex.'$#i', $requestUri, $out)) {
            $this->data = $this->getOnlyStringKeys($out);
            return true;
        }

        return false;
    }
1050420
public function delete(UserInterface $currentUser)
    {
        $request = $this->initHttpRequest($this->account->getApiToken(Token::API_SSO));
        $request->setPath(ApiRequest::PATH_ACCOUNT_DELETED);
        $response = $request->post($currentUser);
        return $this->checkResponse($request, $response);
    }
1256717
protected function normalizeUri($requestUri)
    {
        $len = strlen($requestUri);

        if ($len == 0) {
            return '/';
        }

        if ($len == 1) {
            return $requestUri;
        }

        return trim($requestUri, '/');
    }
1004311
public function createCategoryMenu(array $itemOptions = [], $currentUri = null)
    {
        $menu = $this->factory->createItem('categories', $itemOptions);

        $this->buildCategoryMenu($menu, $itemOptions, $currentUri);

        return $menu;
    }
84787
protected function getMatchingUrlFragment(Request $request, $currentUrlFragment = "")
    {
        if ($currentUrlFragment[strlen($currentUrlFragment) - 1] != "/") {
            $currentUrlFragment .= "/";
        }

        if (stripos($currentUrlFragment, $this->url) === 0) {
            return $this->url;
        }

        return false;
    }
1202057
public static function isValid($httpUri): bool
    {
        if ($httpUri instanceof self) {
            return true;
        }

        if (empty($httpUri) || !is_string($httpUri)) {
            return false;
        }

        try {
            self::fromString($httpUri);
        } catch (MalformedUri $murle) {
            return false;
        }

        return true;
    }
198118
public function validateUri($uri)
    {
        $query = http_build_query(array_merge(
            $this->getOptions()->buildOptions(),
            array('uri' => $uri)
        ));

        $context = stream_context_create(array(
            'http' => array(
                'method' => 'GET',
                'header' => 'User-Agent: HTMLValidator',
            )
        ));

        $data = $this->sendRequest($this->validatorUri . '?' . $query, $context);

        return $this->parseSOAP12Response($data);
    }
612394
public static function parseUri(string $uri){
        if(1 !== preg_match(static::REGEX_URI, $uri, $m)){
            return false;
        }

        $result = [
            "scheme"    => $m["scheme"] ?? "",
            "userinfo"  => $m["userinfo"] ?? "",
            "host"      => $m["host"] ?? "",
            "port"      => "" === $m["port"] ? null : (int)$m["port"],
            "path"      => $m["path"] ?? "",
            "query"     => $m["query"] ?? "",
            "fragment"  => $m["fragment"] ?? "",
        ];

        return $result;
    }
969616
public function matchUri($uri, & $matches = [])
    {
        if ($this->matchAbsoluteUri($uri, $matches)) {
            return true;
        }

        return $this->matchRelativeUri($uri, $matches);
    }
34738
public function hasEndpoint($uri)
    {
        /** @var ArrayCollection $urlsFound */
        $urlsFound = $this->getEndpoints()->filter(function (Endpoint $endpoint) use ($uri) {
            // return when URI and URI string are equal
            return (string) $endpoint->getUri() === $uri;
        });

        return $urlsFound->isEmpty() === false;
    }
1011518
public static function canEdit()
    {
		// Get current user
		$user = eZUser::currentUser();
		$user_has_access = $user->hasAccessTo( 'userpaex', 'editpaex' );

		if ( $user_has_access['accessWord'] == "yes" )
            return true;

        return false;
    }
716454
public function moveBlockUp( $currentIndex )
    {
        $array =& $this->attributes['blocks'];

        $newIndex = $currentIndex - 1;

        if ( $newIndex < 0 || $newIndex >= count( $array ) )
            return false;

        $tmpItem = $array[$newIndex];

        $array[$newIndex] =& $array[$currentIndex];
        $array[$currentIndex] =& $tmpItem;

        if ( $tmpItem->toBeRemoved() )
            $this->moveBlockUp( $newIndex );

        return true;
    }
574738
public function match($uri)
    {
        if (preg_match($this->getParsedPattern(), trim($uri), $matches) > 0) {

            $this->parameters = array_slice($matches, 1);

            return true;
        }

        return false;
    }
956754
public function getCommonRootFolder( $actualUri, $uri )
	{
		$uriParts = array_reverse( explode( "/", $uri ) );
		$actualUriParts = array_reverse( explode( "/", $actualUri ) );

		$count = min( array( count( $uriParts ), count( $actualUriParts ) ) );

		for( $i = 0; $i < $count; $i++ )
		{
			if ( $uriParts[ $i ] != $actualUriParts[ $i ] ) break;
		}

		if ( $uriParts[ $i ] === '' && isset( $uriParts[ $i + 1 ] ) && preg_match_all( "/https?:/", $uriParts[ $i + 1 ] ) )
		{
			$i--;
		}

		return array(
			'actual' => implode( "/", array_reverse( array_slice( $actualUriParts, $i ) ) ),
			'uri'    => implode( "/", array_reverse( array_slice( $uriParts, $i ) ) )
		);
	}
1368236
public static function uri_exist() {
		$routes = new Config('application/config');
		$current_route = str_replace('.php', '', self::get_uri());

		if (array_key_exists($current_route, array_flip(self::reserve))) {
			switch (true) {
				case ($current_route == 'rest'): $parent = 'rest'; break;

				case ($current_route == 'install' || $current_route == 'update'): $parent = 'vcs'; break;

				case ($current_route == 'admin'): $parent = 'admin'; break;

				default: $parent = 'default'; break;
			}

			$route = $routes->get("router/routes/$parent/$current_route");
			$buffer = [];

			foreach (self::$route as $option) {
				$buffer[$option] = $route['options'][$option];
			}
			$buffer['route'] = ($parent?("$parent/"):'').str_replace(['/', '[', ']', ':action'], ['', '', '', $buffer['action']], $buffer['route']);

			self::setRoute((object)$buffer);

			return true;
		}

		//TODO: other routes;

		return false;
    }