Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Router.php

function Router::getCompiledRoutes

2 calls to Router::getCompiledRoutes()
Router::getGenerator in vendor/symfony/routing/Router.php
Gets the UrlGenerator instance associated with this Router.
Router::getMatcher in vendor/symfony/routing/Router.php
Gets the UrlMatcher or RequestMatcher instance associated with this Router.

File

vendor/symfony/routing/Router.php, line 294

Class

Router
The Router class is an example of the integration of all pieces of the routing system for easier use.

Namespace

Symfony\Component\Routing

Code

private static function getCompiledRoutes(string $path) : array {
    if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOL) && (!\in_array(\PHP_SAPI, [
        'cli',
        'phpdbg',
        'embed',
    ], true) || filter_var(\ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOL))) {
        self::$cache = null;
    }
    if (null === self::$cache) {
        return require $path;
    }
    return self::$cache[$path] ??= (require $path);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal