@@ -60,7 +60,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
6060
6161$this->services['baz'] = $instance = new \Baz();
6262
63- $instance->setFoo(($this->services['foo_with_inline'] ?? $this->load(__DIR__.'/ getFooWithInlineService.php')));
63+ $instance->setFoo(($this->services['foo_with_inline'] ?? $this->load(' getFooWithInlineService.php')));
6464
6565return $instance;
6666
@@ -75,7 +75,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
7575$this->services['configured_service'] = $instance = new \stdClass();
7676
7777$a = new \ConfClass();
78- $a->setFoo(($this->services['baz'] ?? $this->load(__DIR__.'/ getBazService.php')));
78+ $a->setFoo(($this->services['baz'] ?? $this->load(' getBazService.php')));
7979
8080$a->configureStdClass($instance);
8181
@@ -145,7 +145,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
145145// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
146146// Returns the public 'factory_service' shared service.
147147
148- return $this->services['factory_service'] = ($this->services['foo.baz'] ?? $this->load(__DIR__.'/ getFoo_BazService.php'))->getInstance();
148+ return $this->services['factory_service'] = ($this->services['foo.baz'] ?? $this->load(' getFoo_BazService.php'))->getInstance();
149149
150150 [Container%s/getFactoryServiceSimpleService.php] => <?php
151151
@@ -155,7 +155,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
155155// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
156156// Returns the public 'factory_service_simple' shared service.
157157
158- return $this->services['factory_service_simple'] = ($this->privates['factory_simple'] ?? $this->load(__DIR__.'/ getFactorySimpleService.php'))->getInstance();
158+ return $this->services['factory_service_simple'] = ($this->privates['factory_simple'] ?? $this->load(' getFactorySimpleService.php'))->getInstance();
159159
160160 [Container%s/getFactorySimpleService.php] => <?php
161161
@@ -177,7 +177,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
177177// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
178178// Returns the public 'foo' shared service.
179179
180- $a = ($this->services['foo.baz'] ?? $this->load(__DIR__.'/ getFoo_BazService.php'));
180+ $a = ($this->services['foo.baz'] ?? $this->load(' getFoo_BazService.php'));
181181
182182$this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, array('bar' => 'foo is bar', 'foobar' => 'bar'), true, $this);
183183
@@ -214,7 +214,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
214214$this->factories['foo_bar'] = function () {
215215 // Returns the public 'foo_bar' service.
216216
217- return new \Bar\FooClass(($this->services['deprecated_service'] ?? $this->load(__DIR__.'/ getDeprecatedServiceService.php')));
217+ return new \Bar\FooClass(($this->services['deprecated_service'] ?? $this->load(' getDeprecatedServiceService.php')));
218218};
219219
220220return $this->factories['foo_bar']();
@@ -232,7 +232,7 @@ $this->services['foo_with_inline'] = $instance = new \Foo();
232232$a = new \Bar();
233233
234234$a->pub = 'pub';
235- $a->setBaz(($this->services['baz'] ?? $this->load(__DIR__.'/ getBazService.php')));
235+ $a->setBaz(($this->services['baz'] ?? $this->load(' getBazService.php')));
236236
237237$instance->setBar($a);
238238
@@ -247,7 +247,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
247247// Returns the public 'lazy_context' shared service.
248248
249249return $this->services['lazy_context'] = new \LazyContext(new RewindableGenerator(function () {
250- yield 'k1' => ($this->services['foo.baz'] ?? $this->load(__DIR__.'/ getFoo_BazService.php'));
250+ yield 'k1' => ($this->services['foo.baz'] ?? $this->load(' getFoo_BazService.php'));
251251 yield 'k2' => $this;
252252}, 2), new RewindableGenerator(function () {
253253 return new \EmptyIterator();
@@ -262,7 +262,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
262262// Returns the public 'lazy_context_ignore_invalid_ref' shared service.
263263
264264return $this->services['lazy_context_ignore_invalid_ref'] = new \LazyContext(new RewindableGenerator(function () {
265- yield 0 => ($this->services['foo.baz'] ?? $this->load(__DIR__.'/ getFoo_BazService.php'));
265+ yield 0 => ($this->services['foo.baz'] ?? $this->load(' getFoo_BazService.php'));
266266}, 1), new RewindableGenerator(function () {
267267 return new \EmptyIterator();
268268}, 0));
@@ -279,9 +279,9 @@ include_once ($this->targetDirs[0].'/Fixtures/includes/foo.php');
279279
280280$this->services['method_call1'] = $instance = new \Bar\FooClass();
281281
282- $instance->setBar(($this->services['foo'] ?? $this->load(__DIR__.'/ getFooService.php')));
282+ $instance->setBar(($this->services['foo'] ?? $this->load(' getFooService.php')));
283283$instance->setBar(NULL);
284- $instance->setBar((($this->services['foo'] ?? $this->load(__DIR__.'/ getFooService.php'))->foo() . (($this->hasParameter("foo")) ? ($this->getParameter("foo")) : ("default"))));
284+ $instance->setBar((($this->services['foo'] ?? $this->load(' getFooService.php'))->foo() . (($this->hasParameter("foo")) ? ($this->getParameter("foo")) : ("default"))));
285285
286286return $instance;
287287
@@ -326,7 +326,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
326326// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
327327// Returns the public 'runtime_error' shared service.
328328
329- return $this->services['runtime_error'] = new \stdClass(($this->privates['errored_definition'] ?? $this->load(__DIR__.'/ getErroredDefinitionService.php')));
329+ return $this->services['runtime_error'] = new \stdClass(($this->privates['errored_definition'] ?? $this->load(' getErroredDefinitionService.php')));
330330
331331 [Container%s/getServiceFromStaticMethodService.php] => <?php
332332
@@ -347,7 +347,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
347347// Returns the public 'tagged_iterator' shared service.
348348
349349return $this->services['tagged_iterator'] = new \Bar(new RewindableGenerator(function () {
350- yield 0 => ($this->services['foo'] ?? $this->load(__DIR__.'/ getFooService.php'));
350+ yield 0 => ($this->services['foo'] ?? $this->load(' getFooService.php'));
351351 yield 1 => ($this->privates['tagged_iterator_foo'] ?? $this->privates['tagged_iterator_foo'] = new \Bar());
352352}, 2));
353353
@@ -382,6 +382,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
382382class ProjectServiceContainer extends Container
383383{
384384 private $buildParameters;
385+ private $containerDir;
385386 private $parameters;
386387 private $targetDirs = array();
387388
@@ -390,13 +391,14 @@ class ProjectServiceContainer extends Container
390391 */
391392 protected $privates = array();
392393
393- public function __construct(array $buildParameters = array())
394+ public function __construct(array $buildParameters = array(), $containerDir = __DIR__ )
394395 {
395- $dir = $this->targetDirs[0] = \dirname(__DIR__ );
396+ $dir = $this->targetDirs[0] = \dirname($containerDir );
396397 for ($i = 1; $i <= 5; ++$i) {
397398 $this->targetDirs[$i] = $dir = \dirname($dir);
398399 }
399400 $this->buildParameters = $buildParameters;
401+ $this->containerDir = $containerDir;
400402 $this->parameters = $this->getDefaultParameters();
401403
402404 $this->services = $this->privates = array();
@@ -407,29 +409,29 @@ class ProjectServiceContainer extends Container
407409 'bar' => 'getBarService',
408410 );
409411 $this->fileMap = array(
410- 'BAR' => __DIR__.'/ getBAR2Service.php',
411- 'BAR2' => __DIR__.'/ getBAR22Service.php',
412- 'bar2' => __DIR__.'/ getBar23Service.php',
413- 'baz' => __DIR__.'/ getBazService.php',
414- 'configured_service' => __DIR__.'/ getConfiguredServiceService.php',
415- 'configured_service_simple' => __DIR__.'/ getConfiguredServiceSimpleService.php',
416- 'decorator_service' => __DIR__.'/ getDecoratorServiceService.php',
417- 'decorator_service_with_name' => __DIR__.'/ getDecoratorServiceWithNameService.php',
418- 'deprecated_service' => __DIR__.'/ getDeprecatedServiceService.php',
419- 'factory_service' => __DIR__.'/ getFactoryServiceService.php',
420- 'factory_service_simple' => __DIR__.'/ getFactoryServiceSimpleService.php',
421- 'foo' => __DIR__.'/ getFooService.php',
422- 'foo.baz' => __DIR__.'/ getFoo_BazService.php',
423- 'foo_bar' => __DIR__.'/ getFooBarService.php',
424- 'foo_with_inline' => __DIR__.'/ getFooWithInlineService.php',
425- 'lazy_context' => __DIR__.'/ getLazyContextService.php',
426- 'lazy_context_ignore_invalid_ref' => __DIR__.'/ getLazyContextIgnoreInvalidRefService.php',
427- 'method_call1' => __DIR__.'/ getMethodCall1Service.php',
428- 'new_factory_service' => __DIR__.'/ getNewFactoryServiceService.php',
429- 'non_shared_foo' => __DIR__.'/ getNonSharedFooService.php',
430- 'runtime_error' => __DIR__.'/ getRuntimeErrorService.php',
431- 'service_from_static_method' => __DIR__.'/ getServiceFromStaticMethodService.php',
432- 'tagged_iterator' => __DIR__.'/ getTaggedIteratorService.php',
412+ 'BAR' => ' getBAR2Service.php',
413+ 'BAR2' => ' getBAR22Service.php',
414+ 'bar2' => ' getBar23Service.php',
415+ 'baz' => ' getBazService.php',
416+ 'configured_service' => ' getConfiguredServiceService.php',
417+ 'configured_service_simple' => ' getConfiguredServiceSimpleService.php',
418+ 'decorator_service' => ' getDecoratorServiceService.php',
419+ 'decorator_service_with_name' => ' getDecoratorServiceWithNameService.php',
420+ 'deprecated_service' => ' getDeprecatedServiceService.php',
421+ 'factory_service' => ' getFactoryServiceService.php',
422+ 'factory_service_simple' => ' getFactoryServiceSimpleService.php',
423+ 'foo' => ' getFooService.php',
424+ 'foo.baz' => ' getFoo_BazService.php',
425+ 'foo_bar' => ' getFooBarService.php',
426+ 'foo_with_inline' => ' getFooWithInlineService.php',
427+ 'lazy_context' => ' getLazyContextService.php',
428+ 'lazy_context_ignore_invalid_ref' => ' getLazyContextIgnoreInvalidRefService.php',
429+ 'method_call1' => ' getMethodCall1Service.php',
430+ 'new_factory_service' => ' getNewFactoryServiceService.php',
431+ 'non_shared_foo' => ' getNonSharedFooService.php',
432+ 'runtime_error' => ' getRuntimeErrorService.php',
433+ 'service_from_static_method' => ' getServiceFromStaticMethodService.php',
434+ 'tagged_iterator' => ' getTaggedIteratorService.php',
433435 );
434436 $this->aliases = array(
435437 'alias_for_alias' => 'foo',
@@ -456,12 +458,12 @@ class ProjectServiceContainer extends Container
456458
457459 public function getRemovedIds()
458460 {
459- return require __DIR__.'/ removed-ids.php';
461+ return require $this->containerDir.\DIRECTORY_SEPARATOR.' removed-ids.php';
460462 }
461463
462464 protected function load($file, $lazyLoad = true)
463465 {
464- return require $file;
466+ return require $this->containerDir.\DIRECTORY_SEPARATOR.$ file;
465467 }
466468
467469 /**
@@ -471,7 +473,7 @@ class ProjectServiceContainer extends Container
471473 */
472474 protected function getBarService()
473475 {
474- $a = ($this->services['foo.baz'] ?? $this->load(__DIR__.'/ getFoo_BazService.php'));
476+ $a = ($this->services['foo.baz'] ?? $this->load(' getFoo_BazService.php'));
475477
476478 $this->services['bar'] = $instance = new \Bar\FooClass('foo', $a, $this->getParameter('foo_bar'));
477479
@@ -580,6 +582,6 @@ return new \Container%s\ProjectServiceContainer(array(
580582 'container.build_hash' => '%s',
581583 'container.build_id' => '%s',
582584 'container.build_time' => %d,
583- ));
585+ ), __DIR__.\DIRECTORY_SEPARATOR.'Container%s' );
584586
585587)
0 commit comments