Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit 05d3665

Browse files
committed
ProxyManager does not write files by default in version 2.* - need to tell it to do so manually
1 parent 3d4e416 commit 05d3665

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ServiceManager.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
use Interop\Container\Exception\ContainerException;
1515
use ProxyManager\Configuration as ProxyConfiguration;
1616
use ProxyManager\Factory\LazyLoadingValueHolderFactory;
17+
use ProxyManager\FileLocator\FileLocator;
1718
use ProxyManager\GeneratorStrategy\EvaluatingGeneratorStrategy;
19+
use ProxyManager\GeneratorStrategy\FileWriterGeneratorStrategy;
1820
use Zend\ServiceManager\Exception\ContainerModificationsNotAllowedException;
1921
use Zend\ServiceManager\Exception\CyclicAliasException;
2022
use Zend\ServiceManager\Exception\InvalidArgumentException;
@@ -750,6 +752,10 @@ private function createLazyServiceDelegatorFactory()
750752

751753
if (! isset($this->lazyServices['write_proxy_files']) || ! $this->lazyServices['write_proxy_files']) {
752754
$factoryConfig->setGeneratorStrategy(new EvaluatingGeneratorStrategy());
755+
} else {
756+
$factoryConfig->setGeneratorStrategy(new FileWriterGeneratorStrategy(
757+
new FileLocator($factoryConfig->getProxiesTargetDir())
758+
));
753759
}
754760

755761
spl_autoload_register($factoryConfig->getProxyAutoloader());

0 commit comments

Comments
 (0)