[DI] Fix tracking of source class changes for lazy-proxies

This commit is contained in:
Nicolas Grekas 2018-01-31 09:22:50 +01:00
parent 0023f4e84d
commit 4f18e4b0dc
2 changed files with 7 additions and 5 deletions

View File

@ -398,6 +398,8 @@ EOTXT;
if (!$proxyDumper->isProxyCandidate($definition)) {
continue;
}
// register class' reflector for resource tracking
$this->container->getReflectionClass($definition->getClass());
$proxyCode = "\n".$proxyDumper->getProxyCode($definition);
if ($strip) {
$proxyCode = "<?php\n".$proxyCode;
@ -1043,10 +1045,10 @@ EOF;
}
$code .= <<<EOF
protected function createProxy(\$class, \Closure \$factory)
{
{$proxyLoader}return \$factory();
}
protected function createProxy(\$class, \Closure \$factory)
{
{$proxyLoader}return \$factory();
}
EOF;
break;

View File

@ -842,7 +842,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
$dumper = new PhpDumper($container);
if (class_exists('ProxyManager\Configuration') && class_exists('Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper')) {
$dumper->setProxyDumper(new ProxyDumper(substr(hash('sha256', $cache->getPath()), 0, 7)));
$dumper->setProxyDumper(new ProxyDumper());
}
$content = $dumper->dump(array(