bug #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
-------
4f18e4b0dc
[DI] Fix tracking of source class changes for lazy-proxies
This commit is contained in:
commit
6cfcfae009
@ -398,6 +398,8 @@ EOTXT;
|
|||||||
if (!$proxyDumper->isProxyCandidate($definition)) {
|
if (!$proxyDumper->isProxyCandidate($definition)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// register class' reflector for resource tracking
|
||||||
|
$this->container->getReflectionClass($definition->getClass());
|
||||||
$proxyCode = "\n".$proxyDumper->getProxyCode($definition);
|
$proxyCode = "\n".$proxyDumper->getProxyCode($definition);
|
||||||
if ($strip) {
|
if ($strip) {
|
||||||
$proxyCode = "<?php\n".$proxyCode;
|
$proxyCode = "<?php\n".$proxyCode;
|
||||||
@ -1043,10 +1045,10 @@ EOF;
|
|||||||
}
|
}
|
||||||
$code .= <<<EOF
|
$code .= <<<EOF
|
||||||
|
|
||||||
protected function createProxy(\$class, \Closure \$factory)
|
protected function createProxy(\$class, \Closure \$factory)
|
||||||
{
|
{
|
||||||
{$proxyLoader}return \$factory();
|
{$proxyLoader}return \$factory();
|
||||||
}
|
}
|
||||||
|
|
||||||
EOF;
|
EOF;
|
||||||
break;
|
break;
|
||||||
|
@ -842,7 +842,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
|||||||
$dumper = new PhpDumper($container);
|
$dumper = new PhpDumper($container);
|
||||||
|
|
||||||
if (class_exists('ProxyManager\Configuration') && class_exists('Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper')) {
|
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(
|
$content = $dumper->dump(array(
|
||||||
|
Reference in New Issue
Block a user