@@ -55,7 +55,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
55
55
56
56
$this->services['baz'] = $instance = new \Baz();
57
57
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')));
59
59
60
60
return $instance;
61
61
@@ -69,7 +69,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
69
69
$this->services['configured_service'] = $instance = new \stdClass();
70
70
71
71
$a = new \ConfClass();
72
- $a->setFoo(($this->services['baz'] ?? $this->load(__DIR__.'/ getBazService.php')));
72
+ $a->setFoo(($this->services['baz'] ?? $this->load(' getBazService.php')));
73
73
74
74
$a->configureStdClass($instance);
75
75
@@ -124,7 +124,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
124
124
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
125
125
// Returns the public 'factory_service' shared service.
126
126
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();
128
128
129
129
[Container%s/getFactoryServiceSimpleService.php] => <?php
130
130
@@ -133,7 +133,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
133
133
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
134
134
// Returns the public 'factory_service_simple' shared service.
135
135
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();
137
137
138
138
[Container%s/getFactorySimpleService.php] => <?php
139
139
@@ -153,7 +153,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
153
153
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
154
154
// Returns the public 'foo' shared service.
155
155
156
- $a = ($this->services['foo.baz'] ?? $this->load(__DIR__.'/ getFoo_BazService.php'));
156
+ $a = ($this->services['foo.baz'] ?? $this->load(' getFoo_BazService.php'));
157
157
158
158
$this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, array('bar' => 'foo is bar', 'foobar' => 'bar'), true, $this);
159
159
@@ -191,7 +191,7 @@ $this->services['foo_with_inline'] = $instance = new \Foo();
191
191
$a = new \Bar();
192
192
193
193
$a->pub = 'pub';
194
- $a->setBaz(($this->services['baz'] ?? $this->load(__DIR__.'/ getBazService.php')));
194
+ $a->setBaz(($this->services['baz'] ?? $this->load(' getBazService.php')));
195
195
196
196
$instance->setBar($a);
197
197
@@ -205,7 +205,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
205
205
// Returns the public 'lazy_context' shared service.
206
206
207
207
return $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'));
209
209
yield 'k2' => $this;
210
210
}, 2), new RewindableGenerator(function () {
211
211
return new \EmptyIterator();
@@ -219,7 +219,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
219
219
// Returns the public 'lazy_context_ignore_invalid_ref' shared service.
220
220
221
221
return $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'));
223
223
}, 1), new RewindableGenerator(function () {
224
224
return new \EmptyIterator();
225
225
}, 0));
@@ -235,9 +235,9 @@ include_once ($this->targetDirs[0].'/Fixtures/includes/foo.php');
235
235
236
236
$this->services['method_call1'] = $instance = new \Bar\FooClass();
237
237
238
- $instance->setBar(($this->services['foo'] ?? $this->load(__DIR__.'/ getFooService.php')));
238
+ $instance->setBar(($this->services['foo'] ?? $this->load(' getFooService.php')));
239
239
$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"))));
241
241
242
242
return $instance;
243
243
@@ -274,7 +274,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
274
274
// Returns the public 'tagged_iterator' shared service.
275
275
276
276
return $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'));
278
278
yield 1 => ($this->privates['tagged_iterator_foo'] ?? $this->privates['tagged_iterator_foo'] = new \Bar());
279
279
}, 2));
280
280
@@ -308,6 +308,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
308
308
class ProjectServiceContainer extends Container
309
309
{
310
310
private $buildParameters;
311
+ private $containerDir;
311
312
private $parameters;
312
313
private $targetDirs = array();
313
314
@@ -316,13 +317,14 @@ class ProjectServiceContainer extends Container
316
317
*/
317
318
protected $privates = array();
318
319
319
- public function __construct(array $buildParameters = array())
320
+ public function __construct(array $buildParameters = array(), $containerDir = __DIR__ )
320
321
{
321
- $dir = $this->targetDirs[0] = \dirname(__DIR__ );
322
+ $dir = $this->targetDirs[0] = \dirname($containerDir );
322
323
for ($i = 1; $i <= 5; ++$i) {
323
324
$this->targetDirs[$i] = $dir = \dirname($dir);
324
325
}
325
326
$this->buildParameters = $buildParameters;
327
+ $this->containerDir = $containerDir;
326
328
$this->parameters = $this->getDefaultParameters();
327
329
328
330
$this->services = $this->privates = array();
@@ -334,26 +336,26 @@ class ProjectServiceContainer extends Container
334
336
'foo_bar' => 'getFooBarService',
335
337
);
336
338
$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',
357
359
);
358
360
$this->aliases = array(
359
361
'alias_for_alias' => 'foo',
@@ -380,12 +382,12 @@ class ProjectServiceContainer extends Container
380
382
381
383
public function getRemovedIds()
382
384
{
383
- return require __DIR__.'/ removed-ids.php';
385
+ return require $this->containerDir.\DIRECTORY_SEPARATOR.' removed-ids.php';
384
386
}
385
387
386
388
protected function load($file, $lazyLoad = true)
387
389
{
388
- return require $file;
390
+ return require $this->containerDir.\DIRECTORY_SEPARATOR.$ file;
389
391
}
390
392
391
393
/**
@@ -395,7 +397,7 @@ class ProjectServiceContainer extends Container
395
397
*/
396
398
protected function getBarService()
397
399
{
398
- $a = ($this->services['foo.baz'] ?? $this->load(__DIR__.'/ getFoo_BazService.php'));
400
+ $a = ($this->services['foo.baz'] ?? $this->load(' getFoo_BazService.php'));
399
401
400
402
$this->services['bar'] = $instance = new \Bar\FooClass('foo', $a, $this->getParameter('foo_bar'));
401
403
@@ -411,7 +413,7 @@ class ProjectServiceContainer extends Container
411
413
*/
412
414
protected function getFooBarService()
413
415
{
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')));
415
417
}
416
418
417
419
public function getParameter($name)
@@ -514,6 +516,6 @@ return new \Container%s\ProjectServiceContainer(array(
514
516
'container.build_hash' => '%s',
515
517
'container.build_id' => '%s',
516
518
'container.build_time' => %d,
517
- ));
519
+ ), __DIR__.\DIRECTORY_SEPARATOR.'Container%s' );
518
520
519
521
)
0 commit comments