@@ -60,7 +60,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
60
60
61
61
$this->services['baz'] = $instance = new \Baz();
62
62
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')));
64
64
65
65
return $instance;
66
66
@@ -75,7 +75,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
75
75
$this->services['configured_service'] = $instance = new \stdClass();
76
76
77
77
$a = new \ConfClass();
78
- $a->setFoo(($this->services['baz'] ?? $this->load(__DIR__.'/ getBazService.php')));
78
+ $a->setFoo(($this->services['baz'] ?? $this->load(' getBazService.php')));
79
79
80
80
$a->configureStdClass($instance);
81
81
@@ -145,7 +145,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
145
145
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
146
146
// Returns the public 'factory_service' shared service.
147
147
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();
149
149
150
150
[Container%s/getFactoryServiceSimpleService.php] => <?php
151
151
@@ -155,7 +155,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
155
155
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
156
156
// Returns the public 'factory_service_simple' shared service.
157
157
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();
159
159
160
160
[Container%s/getFactorySimpleService.php] => <?php
161
161
@@ -177,7 +177,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
177
177
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
178
178
// Returns the public 'foo' shared service.
179
179
180
- $a = ($this->services['foo.baz'] ?? $this->load(__DIR__.'/ getFoo_BazService.php'));
180
+ $a = ($this->services['foo.baz'] ?? $this->load(' getFoo_BazService.php'));
181
181
182
182
$this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, array('bar' => 'foo is bar', 'foobar' => 'bar'), true, $this);
183
183
@@ -214,7 +214,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
214
214
$this->factories['foo_bar'] = function () {
215
215
// Returns the public 'foo_bar' service.
216
216
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')));
218
218
};
219
219
220
220
return $this->factories['foo_bar']();
@@ -232,7 +232,7 @@ $this->services['foo_with_inline'] = $instance = new \Foo();
232
232
$a = new \Bar();
233
233
234
234
$a->pub = 'pub';
235
- $a->setBaz(($this->services['baz'] ?? $this->load(__DIR__.'/ getBazService.php')));
235
+ $a->setBaz(($this->services['baz'] ?? $this->load(' getBazService.php')));
236
236
237
237
$instance->setBar($a);
238
238
@@ -247,7 +247,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
247
247
// Returns the public 'lazy_context' shared service.
248
248
249
249
return $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'));
251
251
yield 'k2' => $this;
252
252
}, 2), new RewindableGenerator(function () {
253
253
return new \EmptyIterator();
@@ -262,7 +262,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
262
262
// Returns the public 'lazy_context_ignore_invalid_ref' shared service.
263
263
264
264
return $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'));
266
266
}, 1), new RewindableGenerator(function () {
267
267
return new \EmptyIterator();
268
268
}, 0));
@@ -279,9 +279,9 @@ include_once ($this->targetDirs[0].'/Fixtures/includes/foo.php');
279
279
280
280
$this->services['method_call1'] = $instance = new \Bar\FooClass();
281
281
282
- $instance->setBar(($this->services['foo'] ?? $this->load(__DIR__.'/ getFooService.php')));
282
+ $instance->setBar(($this->services['foo'] ?? $this->load(' getFooService.php')));
283
283
$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"))));
285
285
286
286
return $instance;
287
287
@@ -326,7 +326,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
326
326
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
327
327
// Returns the public 'runtime_error' shared service.
328
328
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')));
330
330
331
331
[Container%s/getServiceFromStaticMethodService.php] => <?php
332
332
@@ -347,7 +347,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
347
347
// Returns the public 'tagged_iterator' shared service.
348
348
349
349
return $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'));
351
351
yield 1 => ($this->privates['tagged_iterator_foo'] ?? $this->privates['tagged_iterator_foo'] = new \Bar());
352
352
}, 2));
353
353
@@ -382,6 +382,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
382
382
class ProjectServiceContainer extends Container
383
383
{
384
384
private $buildParameters;
385
+ private $containerDir;
385
386
private $parameters;
386
387
private $targetDirs = array();
387
388
@@ -390,13 +391,14 @@ class ProjectServiceContainer extends Container
390
391
*/
391
392
protected $privates = array();
392
393
393
- public function __construct(array $buildParameters = array())
394
+ public function __construct(array $buildParameters = array(), $containerDir = __DIR__ )
394
395
{
395
- $dir = $this->targetDirs[0] = \dirname(__DIR__ );
396
+ $dir = $this->targetDirs[0] = \dirname($containerDir );
396
397
for ($i = 1; $i <= 5; ++$i) {
397
398
$this->targetDirs[$i] = $dir = \dirname($dir);
398
399
}
399
400
$this->buildParameters = $buildParameters;
401
+ $this->containerDir = $containerDir;
400
402
$this->parameters = $this->getDefaultParameters();
401
403
402
404
$this->services = $this->privates = array();
@@ -407,29 +409,29 @@ class ProjectServiceContainer extends Container
407
409
'bar' => 'getBarService',
408
410
);
409
411
$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',
433
435
);
434
436
$this->aliases = array(
435
437
'alias_for_alias' => 'foo',
@@ -456,12 +458,12 @@ class ProjectServiceContainer extends Container
456
458
457
459
public function getRemovedIds()
458
460
{
459
- return require __DIR__.'/ removed-ids.php';
461
+ return require $this->containerDir.\DIRECTORY_SEPARATOR.' removed-ids.php';
460
462
}
461
463
462
464
protected function load($file, $lazyLoad = true)
463
465
{
464
- return require $file;
466
+ return require $this->containerDir.\DIRECTORY_SEPARATOR.$ file;
465
467
}
466
468
467
469
/**
@@ -471,7 +473,7 @@ class ProjectServiceContainer extends Container
471
473
*/
472
474
protected function getBarService()
473
475
{
474
- $a = ($this->services['foo.baz'] ?? $this->load(__DIR__.'/ getFoo_BazService.php'));
476
+ $a = ($this->services['foo.baz'] ?? $this->load(' getFoo_BazService.php'));
475
477
476
478
$this->services['bar'] = $instance = new \Bar\FooClass('foo', $a, $this->getParameter('foo_bar'));
477
479
@@ -580,6 +582,6 @@ return new \Container%s\ProjectServiceContainer(array(
580
582
'container.build_hash' => '%s',
581
583
'container.build_id' => '%s',
582
584
'container.build_time' => %d,
583
- ));
585
+ ), __DIR__.\DIRECTORY_SEPARATOR.'Container%s' );
584
586
585
587
)
0 commit comments