Override the UrlGenerator instance.

@return void
979384
protected function overrideUrlGenerator(): void
    {
        $this->app->singleton('url', function ($app) {
            $routes = $app['router']->getRoutes();

            // The URL generator needs the route collection that exists on the router.
            // Keep in mind this is an object, so we're passing by references here
            // and all the registered routes will be available to the generator.
            $app->instance('routes', $routes);

            $url = new UrlGenerator(
                $routes, $app->rebinding(
                    'request', $this->requestRebinder()
                )
            );

            $url->setSessionResolver(function () {
                return $this->app['session'];
            });

            // If the route collection is "rebound", for example, when the routes stay
            // cached for the application, we will need to rebind the routes on the
            // URL generator instance so it has the latest version of the routes.
            $app->rebinding('routes', function ($app, $routes) {
                $app['url']->setRoutes($routes);
            });

            return $url;
        });
    }
670579
protected function setupUrlRouting()
    {
        $rewriter = new Rewriter();
        $rewriter->initialize();

        $router = Router::urlRouting();

        $this->setConfig("runtime.rewriter_reference", $rewriter);
        $this->setConfig("runtime.router_reference", $router);
    }
262901
public function cleanUrlHandler(): void
    {
        global $pretext;

        $basename = explode('?', (string) $pretext['request_uri']);
        $basename = basename(array_shift($basename));

        if ($basename === 'robots.txt') {
            $this->sendRobots();
        }

        if ($basename === 'sitemap.xml' || $basename === 'sitemap.xml.gz') {
            $this->populateArticleFields()->sendSitemap();
        }
    }
248004
protected function generatePageUrl()
    {
        if ($this->request->getParameter('overridePageUrl')) {
            return $this->request->getParameter('overridePageUrl');
        }

            /** @var $contentObject ContentObjectRenderer */
        $contentObject = GeneralUtility::makeInstance(ContentObjectRenderer::class);

        $typolinkConfiguration = [
            'parameter' => intval($this->page->id),
            'linkAccessRestrictedPages' => '1'
        ];

        $language = GeneralUtility::_GET('L');
        if (!empty($language)) {
            $typolinkConfiguration['additionalParams'] = '&L=' . $language;
        }

        $url = $contentObject->typoLink_URL($typolinkConfiguration);

        // clean up
        if ($url == '') {
            $url = '/';
        }

        return $url;
    }
1107463
private function configureParser()
    {
        $renderer = $parser = null;
        $model = new \RunBB\Model\Admin\Parser();

        $configurator = new \s9e\TextFormatter\Configurator();
        $plugins = unserialize(User::get()->g_parser_plugins);

        $useSmilies = false;
        foreach ($plugins as $k => $plugin) {
            $configurator->plugins->load($plugin);
            if ($plugin === 'Emoticons') {
                $useSmilies = true;
            }
        }

        if ($useSmilies) {
            foreach ($model->getSmilies() as $k => $v) {
                $configurator->Emoticons->add($k, $v['html']);
            }
        }

        $configurator->registeredVars['cacheDir'] = ForumEnv::get('FORUM_CACHE_DIR');

        // Get an instance of the parser and the renderer
        extract($configurator->finalize());

        // We save the parser and the renderer to the disk for easy reuse
        Utils::checkDir($this->cacheDir);

        file_put_contents($this->cacheDir.'/'.User::get()->g_title.'Parser.php', serialize($parser));
        file_put_contents($this->cacheDir.'/'.User::get()->g_title.'Renderer.php', serialize($renderer));

        $this->parser = $parser;
        $this->renderer = $renderer;
    }
924924
private function setUrl() {

		$this -> url = Router :: url($this -> identifier, $this -> params, $this -> domain);

		$url = new URLParser($this -> url);

		if(null === $url -> getScheme() && strlen($this -> url) > 0) {
			$this -> url = '/' . $this -> url;
		}
	}
719260
public function updateUrl()
    {
        // if slug is url
        if (is_slug_url($this->slug)) {
            $this->url = $this->slug;

            return $this;
        }

        $this->url = '';
        $this->generateCompleteUrl($this);
        $this->url = $this->url;

        if (strlen($this->slug) == 1) {
            $this->url = $this->slug;
        }
        else if (strlen($this->slug) > 1) {
            $this->url .= (is_slug_url($this->slug) ? "" : "/") . $this->slug;
        }

        return $this;
    }
375803
private function setUrl() {

		$url = Router :: url($this -> identifier, $this -> params);

		if(strlen($url) > 0) {
			$url = '/' . $url;
		}

		Request :: setURI($url);
		Router :: setUrl($url);
	}
713147
public function getUrl(): ?UrlGenerator
    {
        if (!$this->hasUrl()) {
            $this->setUrl($this->getDefaultUrl());
        }
        return $this->url;
    }
415931
function overrideLunrTokenizer() {

		var origTokenizer = lunr.tokenizer;
		var rSeparators = /[-./#_,;\(\)=><|]/g;

		lunr.tokenizer = function(str) {
			return origTokenizer.call(lunr, str).reduce( function (result, token) {
				if ( rSeparators.test(token) ) {
					token = token.replace(rSeparators, " ");
					result.push.apply(result, token.toLowerCase().split(/ +/));
				} else {
					result.push(token.toLowerCase());
				}
				return result;
			}, []);
		};
		Object.keys(origTokenizer).forEach(function (key) {
			lunr.tokenizer[key] = origTokenizer[key];
		});
	}
416619
public function register()
    {
        Paginator::viewFactoryResolver(function ()
        {
            return $this->app['view'];
        });

        Paginator::currentPathResolver(function ($pageName = 'page')
        {
            return $this->app['request']->url();
        });

        Paginator::currentPageResolver(function ($pageName = 'page')
        {
            $page = $this->app['request']->input($pageName, 1);

            if ((filter_var($page, FILTER_VALIDATE_INT) !== false) && ((int) $page >= 1)) {
                return $page;
            }

            return 1;
        });

        Paginator::urlGeneratorResolver(function (AbstractPaginator $paginator)
        {
            return new UrlGenerator($paginator);
        });
    }
954893
protected function registerMenuGenerator()
    {
        $this->app->bind('menu', function ($app) {

            $this->loadConfigurationOptions();

            $menu = new MenuGenerator(
                $app['url'],
                $app['config'],
                $this->getTheme()
            );

            if ($this->options['control_access']) {
                $menu->setAccessHandler($app[AccessHandler::class]);
            }

            if ($this->options['translate_texts']) {
                $menu->setLang($app['translator']);
            }

            return $menu;
        });
    }
673417
public function set_url() {

		$plugins_url = plugins_url();
		$this_url    = trim( substr( trailingslashit( plugin_dir_url( __FILE__ ) ), strlen( $plugins_url ) ), '/' );

		if ( false !== strpos( $this_url, '/' ) ) {
			$url_path = explode( '/', $this_url );
			// generic 3 path depth: classes/namespace/ui|data.
			array_splice( $url_path, count( $url_path ) - 3 );
			$this_url = implode( '/', $url_path );
		}
		// setup the base URL.
		$this->url = trailingslashit( $plugins_url . '/' . $this_url );
	}
1064523
public function setUrl($name, $value)
    {
        if ($this->callerNotSelfOrChild()) {
            Deprecated::method(3.3, 'Use UrlGenerator or Asset Packages instead.');
        }

        $this->urls[$name] = $value;
    }
1139442
private function replaceRouteServiceProvider()
    {
        $this->info("Replacing the RouteServiceProvider...");
        $this->helper->moveFile($this->pathOriginalRouteServiceProvider, $this->config->paths->project->RouteServiceProvider);
        $this->helper->removeDir($this->pathOriginalProviders);
        $this->helper->replaceAndSave($this->config->paths->project->RouteServiceProvider, "", "");    // without saving the RouteServiceProvider was not registered
        $this->bar->advance();
    }
534321
public function toRelative(): UrlPathInterface
    {
        return new self(false, $this->myAboveBaseLevel, $this->myDirectoryParts, $this->myFilename);
    }
414705
public function register()
    {
        $this->app->singleton('FluxBB\Web\UrlGeneratorInterface', function ($app) {
            return new UrlGenerator($app['FluxBB\Web\Router'], $app['url']);
        });

        $this->app->singleton('FluxBB\Auth\AuthenticatorInterface', 'FluxBB\Integration\Laravel\Authenticator');
    }