Gets the UrlMatcher instance associated with this Router.

@return UrlMatcherInterface A UrlMatcherInterface instance
432117
public function getMatcher()
    {
        if (null !== $this->matcher) {
            return $this->matcher;
        }

        $compiled = is_a($this->options['matcher_class'], CompiledUrlMatcher::class, true) && (UrlMatcher::class === $this->options['matcher_base_class'] || RedirectableUrlMatcher::class === $this->options['matcher_base_class']);

        if (null === $this->options['cache_dir'] || null === $this->options['matcher_cache_class']) {
            $routes = $this->getRouteCollection();
            if ($compiled) {
                $routes = (new CompiledUrlMatcherDumper($routes))->getCompiledRoutes();
            }
            $this->matcher = new $this->options['matcher_class']($routes, $this->context);
            if (method_exists($this->matcher, 'addExpressionLanguageProvider')) {
                foreach ($this->expressionLanguageProviders as $provider) {
                    $this->matcher->addExpressionLanguageProvider($provider);
                }
            }

            return $this->matcher;
        }

        $cache = $this->getConfigCacheFactory()->cache($this->options['cache_dir'].'/'.$this->options['matcher_cache_class'].'.php',
            function (ConfigCacheInterface $cache) {
                $dumper = $this->getMatcherDumperInstance();
                if (method_exists($dumper, 'addExpressionLanguageProvider')) {
                    foreach ($this->expressionLanguageProviders as $provider) {
                        $dumper->addExpressionLanguageProvider($provider);
                    }
                }

                $options = [
                    'class' => $this->options['matcher_cache_class'],
                    'base_class' => $this->options['matcher_base_class'],
                ];

                $cache->write($dumper->dump($options), $this->getRouteCollection()->getResources());
            }
        );

        if ($compiled) {
            return $this->matcher = new $this->options['matcher_class'](require $cache->getPath(), $this->context);
        }

        if (!class_exists($this->options['matcher_cache_class'], false)) {
            require_once $cache->getPath();
        }

        return $this->matcher = new $this->options['matcher_cache_class']($this->context);
    }
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
        );
    }
1084986
public function getHttpAdapter()
    {
        if (null === $this->httpAdapter) {
            $this->httpAdapter = new Http\Client\Adapter\Curl();
            $this->httpAdapter->setOptions(array(
                'curloptions' => array(
                    CURLOPT_SSL_VERIFYPEER => false,
                ),
            ));
        }

        return $this->httpAdapter;
    }
417849
public function getRouteMatch()
    {
        if ($this->routeMatch instanceof RouteMatch) {
            return $this->routeMatch;
        }

        $controller = $this->getController();

        if (!$controller instanceof InjectApplicationEventInterface) {
            throw new Exception\DomainException(
                'Url plugin requires a controller that implements InjectApplicationEventInterface'
            );
        }

        $event      = $controller->getEvent();
        $routeMatch = null;

        if ($event instanceof MvcEvent) {
            $routeMatch = $event->getRouteMatch();
        } elseif ($event instanceof EventInterface) {
            $routeMatch = $event->getParam('route-match', false);
        }

        if (!($routeMatch instanceof RouteMatch)) {
            throw new Exception\RuntimeException('Url plugin requires event compose a route match');
        }

        return $this->routeMatch;
    }
2868
public function getRedirectUrlBase()
    {
        // URLConfirmationTokens may alter the URL to suppress the URL they're protecting,
        // so we need to ensure they're inspected last and therefore take priority
        $tokens = iterator_to_array($this->filteredTokens(), false);
        usort($tokens, function ($a, $b) {
            return ($a instanceof URLConfirmationToken) ? 1 : 0;
        });

        $urlBase = Director::baseURL();
        foreach ($tokens as $token) {
            $urlBase = $token->getRedirectUrlBase();
        }

        return $urlBase;
    }
1094508
public function getMatcher()
    {
        if (null === $this->matcher) {
            $this->setMatcher($this->getRouterContainer()->getMatcher());
        }
        return $this->matcher;
    }
151310
public function getRouter()
    {
        if (is_null($this->router)) {
            if (method_exists($this, 'resolve')) {
                $this->setRouter($this->resolve(Router::class));
            } else {
                $this->setRouter(new Router());
            }
        }

        return $this->router;
    }
723303
public function getRouter() {
        $routesIni = $this->_getRoutesConfig();
        $this->setOptions($routesIni->toArray());
        $options = $this->getOptions();

        if ($this->_localeIsEnabled()) {
            $bootstrap = $this->getBootstrap();

            if (!$this->_locale) {
                $bootstrap->bootstrap('Locale');
                $this->_locale = $bootstrap->getContainer()->locale;
            }

            $defaultLocale = array_keys($this->_locale->getDefault());
            $defaultLocale = $defaultLocale[0];

            $locales = $this->_getPossibleLocales();
            $routes = $options['routes'];
            $localizedRoutes = Garp_I18n::getLocalizedRoutes($routes, $locales);
            $options['routes'] = array_merge($routes, $localizedRoutes);
            $this->setOptions($options);
        }

        $router = parent::getRouter();
        $router->addDefaultRoutes();
        return $router;
    }
166313
public function getURL()
    {
        $url = $this->_internal_request->get_normalized_http_url();

        if ($this->getMethod() == AnHttpRequest::GET) {
            $url = $this->_internal_request->to_url();
        }

        return $url;
    }
521871
public function getRouter()
	{
	    $name = 'router';
	    if (!$this->has($name)) {
	        $this->set($name, function () {
	            /*@var FastRouter $router */
	            $router = new FastRouter();
	            
	            $cacheFile = Config::getCommon('router.cache_file');
	            if (!Config::getCommon('debug') && $cacheFile) {
	                $router->setCacheFile($cacheFile);
	            }
	            
	            $routes = Config::load('routes');
	            if ($routes) {
	                $router->loadRoutes($routes);
	            }
	            
	            return $router;
	        });
	    }
	    return $this->get($name);
	}
344583
public function getURLService()
    {
        if ($this->urlService !== null) {
            return $this->urlService;
        }

        $this->urlService = new URLService(
            $this,
            $this->persistenceHandler->urlHandler()
        );

        return $this->urlService;
    }
1200782
protected function routeUrl()
    {
        if (! $this->routeGenerator) {
            $this->routeGenerator = new RouteUrlGenerator($this, $this->request);
        }

        return $this->routeGenerator;
    }
253031
public function getRequestHandler()
    {
        if (isset($this->requestHandler))
            return $this->requestHandler;

        // now instantiating handler from config
        $handlerClass = "\\" . ltrim($this->handlerClass, "\\");
        if (!class_exists($handlerClass))
            throw new RuntimeException("Unable to create HTTP Handler instance with class: " . var_export($handlerClass, true));

        $this->requestHandler = new $handlerClass();
        return $this->requestHandler;
    }
505395
public function getUrl()
    {
		if ($this->isLink()) {
			if ($this->getParentServer()->id != $this->prototype->getParentServer()->id) {
				return $this->prototype->getFullUrl();
			}
			else {
				return $this->prototype->getUrl();
			}
		}
		else {
			if ($this->_url === FALSE) $this->fillPath();
			return $this->_url;
		}
    }
267458
public function get() {
		$this->RoutedStatus = FALSE;

		if ( ! $this->route->isGet() ) {
			return $this;
		}

		if ( is_callable( $this->callable ) ) {
			//$this->RoutedStatus = FALSE;
			return $this;
		}

		$this->middleware = array( 'before' => array(), 'after' => array() );
		self::$FullRender = '';
		$args             = func_get_args();

		if ( ! empty( self::$group ) ) {

			if ( $args[0] == '/' ) {
				$args[0] = substr( self::$group, 0, - 1 );
			} else {
				$args[0] = self::$group . $args[0];
			}

		}

		array_push( Route::$list, $args[0] );
		$this->setCallable( $args );

		return $this;
	}
26413
public static function getCurrentRoute()
    {
        if (!static::$currentRoute) {
            $uri = Grav::instance()['uri'];
            static::$currentRoute = RouteFactory::createFromParts($uri->toArray());
        }

        return static::$currentRoute;
    }
1291462
public function getCurrentUrlFolder() {
        $url = self::getCurrentUrl();
        $pieces = explode('/', $url);
        array_pop($pieces);
        $retval = implode('/', $pieces);
        return $retval;
    }