Aggiornato Composer
This commit is contained in:
10
vendor/symfony/routing/Router.php
vendored
10
vendor/symfony/routing/Router.php
vendored
@@ -97,7 +97,7 @@ class Router implements RouterInterface, RequestMatcherInterface
|
||||
/**
|
||||
* @param mixed $resource The main resource to load
|
||||
*/
|
||||
public function __construct(LoaderInterface $loader, $resource, array $options = [], RequestContext $context = null, LoggerInterface $logger = null, string $defaultLocale = null)
|
||||
public function __construct(LoaderInterface $loader, $resource, array $options = [], ?RequestContext $context = null, ?LoggerInterface $logger = null, ?string $defaultLocale = null)
|
||||
{
|
||||
$this->loader = $loader;
|
||||
$this->resource = $resource;
|
||||
@@ -313,14 +313,12 @@ class Router implements RouterInterface, RequestMatcherInterface
|
||||
|
||||
if (null === $this->options['cache_dir']) {
|
||||
$routes = $this->getRouteCollection();
|
||||
$aliases = [];
|
||||
$compiled = is_a($this->options['generator_class'], CompiledUrlGenerator::class, true);
|
||||
if ($compiled) {
|
||||
$generatorDumper = new CompiledUrlGeneratorDumper($routes);
|
||||
$routes = $generatorDumper->getCompiledRoutes();
|
||||
$aliases = $generatorDumper->getCompiledAliases();
|
||||
$routes = array_merge($generatorDumper->getCompiledRoutes(), $generatorDumper->getCompiledAliases());
|
||||
}
|
||||
$this->generator = new $this->options['generator_class'](array_merge($routes, $aliases), $this->context, $this->logger, $this->defaultLocale);
|
||||
$this->generator = new $this->options['generator_class']($routes, $this->context, $this->logger, $this->defaultLocale);
|
||||
} else {
|
||||
$cache = $this->getConfigCacheFactory()->cache($this->options['cache_dir'].'/url_generating_routes.php',
|
||||
function (ConfigCacheInterface $cache) {
|
||||
@@ -376,7 +374,7 @@ class Router implements RouterInterface, RequestMatcherInterface
|
||||
|
||||
private static function getCompiledRoutes(string $path): array
|
||||
{
|
||||
if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOLEAN))) {
|
||||
if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(\ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOLEAN))) {
|
||||
self::$cache = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user