@@ -55,7 +55,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
5555
5656$this->services['baz'] = $instance = new \Baz();
5757
58- $instance->setFoo(($this->services['foo_with_inline'] ?? $this->load(__DIR__.'/ getFooWithInlineService.php')));
58+ $instance->setFoo(($this->services['foo_with_inline'] ?? $this->load(' getFooWithInlineService.php')));
5959
6060return $instance;
6161
@@ -69,7 +69,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
6969$this->services['configured_service'] = $instance = new \stdClass();
7070
7171$a = new \ConfClass();
72- $a->setFoo(($this->services['baz'] ?? $this->load(__DIR__.'/ getBazService.php')));
72+ $a->setFoo(($this->services['baz'] ?? $this->load(' getBazService.php')));
7373
7474$a->configureStdClass($instance);
7575
@@ -124,7 +124,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
124124// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
125125// Returns the public 'factory_service' shared service.
126126
127- return $this->services['factory_service'] = ($this->services['foo.baz'] ?? $this->load(__DIR__.'/ getFoo_BazService.php'))->getInstance();
127+ return $this->services['factory_service'] = ($this->services['foo.baz'] ?? $this->load(' getFoo_BazService.php'))->getInstance();
128128
129129 [Container%s/getFactoryServiceSimpleService.php] => <?php
130130
@@ -133,7 +133,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
133133// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
134134// Returns the public 'factory_service_simple' shared service.
135135
136- return $this->services['factory_service_simple'] = ($this->privates['factory_simple'] ?? $this->load(__DIR__.'/ getFactorySimpleService.php'))->getInstance();
136+ return $this->services['factory_service_simple'] = ($this->privates['factory_simple'] ?? $this->load(' getFactorySimpleService.php'))->getInstance();
137137
138138 [Container%s/getFactorySimpleService.php] => <?php
139139
@@ -153,7 +153,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
153153// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
154154// Returns the public 'foo' shared service.
155155
156- $a = ($this->services['foo.baz'] ?? $this->load(__DIR__.'/ getFoo_BazService.php'));
156+ $a = ($this->services['foo.baz'] ?? $this->load(' getFoo_BazService.php'));
157157
158158$this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, array('bar' => 'foo is bar', 'foobar' => 'bar'), true, $this);
159159
@@ -191,7 +191,7 @@ $this->services['foo_with_inline'] = $instance = new \Foo();
191191$a = new \Bar();
192192
193193$a->pub = 'pub';
194- $a->setBaz(($this->services['baz'] ?? $this->load(__DIR__.'/ getBazService.php')));
194+ $a->setBaz(($this->services['baz'] ?? $this->load(' getBazService.php')));
195195
196196$instance->setBar($a);
197197
@@ -205,7 +205,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
205205// Returns the public 'lazy_context' shared service.
206206
207207return $this->services['lazy_context'] = new \LazyContext(new RewindableGenerator(function () {
208- yield 'k1' => ($this->services['foo.baz'] ?? $this->load(__DIR__.'/ getFoo_BazService.php'));
208+ yield 'k1' => ($this->services['foo.baz'] ?? $this->load(' getFoo_BazService.php'));
209209 yield 'k2' => $this;
210210}, 2), new RewindableGenerator(function () {
211211 return new \EmptyIterator();
@@ -219,7 +219,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
219219// Returns the public 'lazy_context_ignore_invalid_ref' shared service.
220220
221221return $this->services['lazy_context_ignore_invalid_ref'] = new \LazyContext(new RewindableGenerator(function () {
222- yield 0 => ($this->services['foo.baz'] ?? $this->load(__DIR__.'/ getFoo_BazService.php'));
222+ yield 0 => ($this->services['foo.baz'] ?? $this->load(' getFoo_BazService.php'));
223223}, 1), new RewindableGenerator(function () {
224224 return new \EmptyIterator();
225225}, 0));
@@ -235,9 +235,9 @@ include_once ($this->targetDirs[0].'/Fixtures/includes/foo.php');
235235
236236$this->services['method_call1'] = $instance = new \Bar\FooClass();
237237
238- $instance->setBar(($this->services['foo'] ?? $this->load(__DIR__.'/ getFooService.php')));
238+ $instance->setBar(($this->services['foo'] ?? $this->load(' getFooService.php')));
239239$instance->setBar(NULL);
240- $instance->setBar((($this->services['foo'] ?? $this->load(__DIR__.'/ getFooService.php'))->foo() . (($this->hasParameter("foo")) ? ($this->getParameter("foo")) : ("default"))));
240+ $instance->setBar((($this->services['foo'] ?? $this->load(' getFooService.php'))->foo() . (($this->hasParameter("foo")) ? ($this->getParameter("foo")) : ("default"))));
241241
242242return $instance;
243243
@@ -274,7 +274,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
274274// Returns the public 'tagged_iterator' shared service.
275275
276276return $this->services['tagged_iterator'] = new \Bar(new RewindableGenerator(function () {
277- yield 0 => ($this->services['foo'] ?? $this->load(__DIR__.'/ getFooService.php'));
277+ yield 0 => ($this->services['foo'] ?? $this->load(' getFooService.php'));
278278 yield 1 => ($this->privates['tagged_iterator_foo'] ?? $this->privates['tagged_iterator_foo'] = new \Bar());
279279}, 2));
280280
@@ -308,6 +308,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
308308class ProjectServiceContainer extends Container
309309{
310310 private $buildParameters;
311+ private $containerDir;
311312 private $parameters;
312313 private $targetDirs = array();
313314
@@ -316,13 +317,14 @@ class ProjectServiceContainer extends Container
316317 */
317318 protected $privates = array();
318319
319- public function __construct(array $buildParameters = array())
320+ public function __construct(array $buildParameters = array(), $containerDir = __DIR__ )
320321 {
321- $dir = $this->targetDirs[0] = \dirname(__DIR__ );
322+ $dir = $this->targetDirs[0] = \dirname($containerDir );
322323 for ($i = 1; $i <= 5; ++$i) {
323324 $this->targetDirs[$i] = $dir = \dirname($dir);
324325 }
325326 $this->buildParameters = $buildParameters;
327+ $this->containerDir = $containerDir;
326328 $this->parameters = $this->getDefaultParameters();
327329
328330 $this->services = $this->privates = array();
@@ -334,26 +336,26 @@ class ProjectServiceContainer extends Container
334336 'foo_bar' => 'getFooBarService',
335337 );
336338 $this->fileMap = array(
337- 'BAR' => __DIR__.'/ getBAR2Service.php',
338- 'BAR2' => __DIR__.'/ getBAR22Service.php',
339- 'bar2' => __DIR__.'/ getBar23Service.php',
340- 'baz' => __DIR__.'/ getBazService.php',
341- 'configured_service' => __DIR__.'/ getConfiguredServiceService.php',
342- 'configured_service_simple' => __DIR__.'/ getConfiguredServiceSimpleService.php',
343- 'decorator_service' => __DIR__.'/ getDecoratorServiceService.php',
344- 'decorator_service_with_name' => __DIR__.'/ getDecoratorServiceWithNameService.php',
345- 'deprecated_service' => __DIR__.'/ getDeprecatedServiceService.php',
346- 'factory_service' => __DIR__.'/ getFactoryServiceService.php',
347- 'factory_service_simple' => __DIR__.'/ getFactoryServiceSimpleService.php',
348- 'foo' => __DIR__.'/ getFooService.php',
349- 'foo.baz' => __DIR__.'/ getFoo_BazService.php',
350- 'foo_with_inline' => __DIR__.'/ getFooWithInlineService.php',
351- 'lazy_context' => __DIR__.'/ getLazyContextService.php',
352- 'lazy_context_ignore_invalid_ref' => __DIR__.'/ getLazyContextIgnoreInvalidRefService.php',
353- 'method_call1' => __DIR__.'/ getMethodCall1Service.php',
354- 'new_factory_service' => __DIR__.'/ getNewFactoryServiceService.php',
355- 'service_from_static_method' => __DIR__.'/ getServiceFromStaticMethodService.php',
356- 'tagged_iterator' => __DIR__.'/ getTaggedIteratorService.php',
339+ 'BAR' => ' getBAR2Service.php',
340+ 'BAR2' => ' getBAR22Service.php',
341+ 'bar2' => ' getBar23Service.php',
342+ 'baz' => ' getBazService.php',
343+ 'configured_service' => ' getConfiguredServiceService.php',
344+ 'configured_service_simple' => ' getConfiguredServiceSimpleService.php',
345+ 'decorator_service' => ' getDecoratorServiceService.php',
346+ 'decorator_service_with_name' => ' getDecoratorServiceWithNameService.php',
347+ 'deprecated_service' => ' getDeprecatedServiceService.php',
348+ 'factory_service' => ' getFactoryServiceService.php',
349+ 'factory_service_simple' => ' getFactoryServiceSimpleService.php',
350+ 'foo' => ' getFooService.php',
351+ 'foo.baz' => ' getFoo_BazService.php',
352+ 'foo_with_inline' => ' getFooWithInlineService.php',
353+ 'lazy_context' => ' getLazyContextService.php',
354+ 'lazy_context_ignore_invalid_ref' => ' getLazyContextIgnoreInvalidRefService.php',
355+ 'method_call1' => ' getMethodCall1Service.php',
356+ 'new_factory_service' => ' getNewFactoryServiceService.php',
357+ 'service_from_static_method' => ' getServiceFromStaticMethodService.php',
358+ 'tagged_iterator' => ' getTaggedIteratorService.php',
357359 );
358360 $this->aliases = array(
359361 'alias_for_alias' => 'foo',
@@ -380,12 +382,12 @@ class ProjectServiceContainer extends Container
380382
381383 public function getRemovedIds()
382384 {
383- return require __DIR__.'/ removed-ids.php';
385+ return require $this->containerDir.\DIRECTORY_SEPARATOR.' removed-ids.php';
384386 }
385387
386388 protected function load($file, $lazyLoad = true)
387389 {
388- return require $file;
390+ return require $this->containerDir.\DIRECTORY_SEPARATOR.$ file;
389391 }
390392
391393 /**
@@ -395,7 +397,7 @@ class ProjectServiceContainer extends Container
395397 */
396398 protected function getBarService()
397399 {
398- $a = ($this->services['foo.baz'] ?? $this->load(__DIR__.'/ getFoo_BazService.php'));
400+ $a = ($this->services['foo.baz'] ?? $this->load(' getFoo_BazService.php'));
399401
400402 $this->services['bar'] = $instance = new \Bar\FooClass('foo', $a, $this->getParameter('foo_bar'));
401403
@@ -411,7 +413,7 @@ class ProjectServiceContainer extends Container
411413 */
412414 protected function getFooBarService()
413415 {
414- return new \Bar\FooClass(($this->services['deprecated_service'] ?? $this->load(__DIR__.'/ getDeprecatedServiceService.php')));
416+ return new \Bar\FooClass(($this->services['deprecated_service'] ?? $this->load(' getDeprecatedServiceService.php')));
415417 }
416418
417419 public function getParameter($name)
@@ -514,6 +516,6 @@ return new \Container%s\ProjectServiceContainer(array(
514516 'container.build_hash' => '%s',
515517 'container.build_id' => '%s',
516518 'container.build_time' => %d,
517- ));
519+ ), __DIR__.\DIRECTORY_SEPARATOR.'Container%s' );
518520
519521)
0 commit comments