10000 bug #25981 [DI] Fix tracking of source class changes for lazy-proxies… · sroze/symfony@6cfcfae · GitHub
[go: up one dir, main page]

Skip to content

Commit 6cfcfae

Browse files
committed
bug symfony#25981 [DI] Fix tracking of source class changes for lazy-proxies (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [DI] Fix tracking of source class changes for lazy-proxies | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- 4f18e4b [DI] Fix tracking of source class changes for lazy-proxies
2 parents 5f770d7 + 4f18e4b commit 6cfcfae

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,8 @@ private function generateProxyClasses()
398398
if (!$proxyDumper->isProxyCandidate($definition)) {
399399
continue;
400400
}
401+
// register class' reflector for resource tracking
402+
$this->container->getReflectionClass($definition->getClass());
401403
$proxyCode = "\n".$proxyDumper->getProxyCode($definition);
402404
if ($strip) {
403405
$proxyCode = "<?php\n".$proxyCode;
@@ -1043,10 +1045,10 @@ protected function load(\$file, \$lazyLoad = true)
10431045
}
10441046
$code .= <<<EOF
10451047
1046-
protected function createProxy(\$class, \Closure \$factory)
1047-
{
1048-
{$proxyLoader}return \$factory();
1049-
}
1048+
protected function createProxy(\$class, \Closure \$factory)
1049+
{
1050+
{$proxyLoader}return \$factory();
1051+
}
10501052
10511053
EOF;
10521054
break;

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container
842842
$dumper = new PhpDumper($container);
843843

844844
if (class_exists('ProxyManager\Configuration') && class_exists('Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper')) {
845-
$dumper->setProxyDumper(new ProxyDumper(substr(hash('sha256', $cache->getPath()), 0, 7)));
845+
$dumper->setProxyDumper(new ProxyDumper());
846846
}
847847

848848
$content = $dumper->dump(array(

0 commit comments

Comments
 (0)
0