Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 19961cd

Browse files
HypeMCnicolas-grekas
authored andcommitted
[Routing] Don't rebuild cache when controller action body changes
1 parent 7614b8c commit 19961cd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Loader/AttributeClassLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\Config\Loader\LoaderInterface;
1515
use Symfony\Component\Config\Loader\LoaderResolverInterface;
16-
use Symfony\Component\Config\Resource\FileResource;
16+
use Symfony\Component\Config\Resource\ReflectionClassResource;
1717
use Symfony\Component\Routing\Attribute\DeprecatedAlias;
1818
use Symfony\Component\Routing\Attribute\Route as RouteAttribute;
1919
use Symfony\Component\Routing\Exception\InvalidArgumentException;
@@ -104,7 +104,7 @@ public function load(mixed $class, ?string $type = null): RouteCollection
104104

105105
$globals = $this->getGlobals($class);
106106
$collection = new RouteCollection();
107-
$collection->addResource(new FileResource($class->getFileName()));
107+
$collection->addResource(new ReflectionClassResource($class));
108108
if ($globals['env'] && $this->env !== $globals['env']) {
109109
return $collection;
110110
}

Loader/AttributeDirectoryLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Routing\Loader;
1313

14-
use Symfony\Component\Config\Resource\DirectoryResource;
14+
use Symfony\Component\Config\Resource\GlobResource;
1515
use Symfony\Component\Routing\RouteCollection;
1616

1717
/**
@@ -33,7 +33,7 @@ public function load(mixed $path, ?string $type = null): ?RouteCollection
3333
}
3434

3535
$collection = new RouteCollection();
36-
$collection->addResource(new DirectoryResource($dir, '/\.php$/'));
36+
$collection->addResource(new GlobResource($dir, '/*.php', true));
3737
$files = iterator_to_array(new \RecursiveIteratorIterator(
3838
new \RecursiveCallbackFilterIterator(
3939
new \RecursiveDirectoryIterator($dir, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS),

Loader/AttributeFileLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\Config\FileLocatorInterface;
1515
use Symfony\Component\Config\Loader\FileLoader;
16-
use Symfony\Component\Config\Resource\FileResource;
16+
use Symfony\Component\Config\Resource\ReflectionClassResource;
1717
use Symfony\Component\Routing\RouteCollection;
1818

1919
/**
@@ -52,7 +52,7 @@ public function load(mixed $file, ?string $type = null): ?RouteCollection
5252
return null;
5353
}
5454

55-
$collection->addResource(new FileResource($path));
55+
$collection->addResource(new ReflectionClassResource($refl));
5656
$collection->addCollection($this->loader->load($class, $type));
5757
}
5858

0 commit comments

Comments
 (0)