@@ -24,7 +24,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
24
24
25
25
$this->services['baz'] = $instance = new \Baz();
26
26
27
- $instance->setFoo(${($_ = isset($this->services['foo_with_inline']) ? $this->services['foo_with_inline'] : $this->load(__DIR__.'/ getFooWithInlineService.php')) && false ?: '_'});
27
+ $instance->setFoo(${($_ = isset($this->services['foo_with_inline']) ? $this->services['foo_with_inline'] : $this->load(' getFooWithInlineService.php')) && false ?: '_'});
28
28
29
29
return $instance;
30
30
@@ -38,7 +38,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
38
38
$this->services['configured_service'] = $instance = new \stdClass();
39
39
40
40
$a = new \ConfClass();
41
- $a->setFoo(${($_ = isset($this->services['baz']) ? $this->services['baz'] : $this->load(__DIR__.'/ getBazService.php')) && false ?: '_'});
41
+ $a->setFoo(${($_ = isset($this->services['baz']) ? $this->services['baz'] : $this->load(' getBazService.php')) && false ?: '_'});
42
42
43
43
$a->conf
10000
igureStdClass($instance);
44
44
@@ -93,7 +93,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
93
93
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
94
94
// Returns the public 'factory_service' shared service.
95
95
96
- return $this->services['factory_service'] = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->load(__DIR__.'/ getFoo_BazService.php')) && false ?: '_'}->getInstance();
96
+ return $this->services['factory_service'] = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->load(' getFoo_BazService.php')) && false ?: '_'}->getInstance();
97
97
98
98
[Container%s/getFactoryServiceSimpleService.php] => <?php
99
99
@@ -102,7 +102,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
102
102
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
103
103
// Returns the public 'factory_service_simple' shared service.
104
104
105
- return $this->services['factory_service_simple'] = ${($_ = isset($this->services['factory_simple']) ? $this->services['factory_simple'] : $this->load(__DIR__.'/ getFactorySimpleService.php')) && false ?: '_'}->getInstance();
105
+ return $this->services['factory_service_simple'] = ${($_ = isset($this->services['factory_simple']) ? $this->services['factory_simple'] : $this->load(' getFactorySimpleService.php')) && false ?: '_'}->getInstance();
106
106
107
107
[Container%s/getFactorySimpleService.php] => <?php
108
108
@@ -122,7 +122,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
122
122
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
123
123
// Returns the public 'foo' shared service.
124
124
125
- $a = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->load(__DIR__.'/ getFoo_BazService.php')) && false ?: '_'};
125
+ $a = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->load(' getFoo_BazService.php')) && false ?: '_'};
126
126
127
127
$this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, array('bar' => 'foo is bar', 'foobar' => 'bar'), true, $this);
128
128
@@ -160,7 +160,7 @@ $this->services['foo_with_inline'] = $instance = new \Foo();
160
160
$a = new \Bar();
161
161
162
162
$a->pub = 'pub';
163
- $a->setBaz(${($_ = isset($this->services['baz']) ? $this->services['baz'] : $this->load(__DIR__.'/ getBazService.php')) && false ?: '_'});
163
+ $a->setBaz(${($_ = isset($this->services['baz']) ? $this->services['baz'] : $this->load(' getBazService.php')) && false ?: '_'});
164
164
165
165
$instance->setBar($a);
166
166
@@ -174,7 +174,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
174
174
// Returns the public 'lazy_context' shared service.
175
175
176
176
return $this->services['lazy_context'] = new \LazyContext(new RewindableGenerator(function () {
177
- yield 'k1' => ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->load(__DIR__.'/ getFoo_BazService.php')) && false ?: '_'};
177
+ yield 'k1' => ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->load(' getFoo_BazService.php')) && false ?: '_'};
178
178
yield 'k2' => $this;
179
179
}, 2), new RewindableGenerator(function () {
180
180
return new \EmptyIterator();
@@ -188,7 +188,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
188
188
// Returns the public 'lazy_context_ignore_invalid_ref' shared service.
189
189
190
190
return $this->services['lazy_context_ignore_invalid_ref'] = new \LazyContext(new RewindableGenerator(function () {
191
- yield 0 => ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->load(__DIR__.'/ getFoo_BazService.php')) && false ?: '_'};
191
+ yield 0 => ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->load(' getFoo_BazService.php')) && false ?: '_'};
192
192
}, 1), new RewindableGenerator(function () {
193
193
return new \EmptyIterator();
194
194
}, 0));
@@ -204,9 +204,9 @@ include_once ($this->targetDirs[0].'/Fixtures/includes/foo.php');
204
204
205
205
$this->services['method_call1'] = $instance = new \Bar\FooClass();
206
206
207
- $instance->setBar(${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->load(__DIR__.'/ getFooService.php')) && false ?: '_'});
207
+ $instance->setBar(${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->load(' getFooService.php')) && false ?: '_'});
208
208
$instance->setBar(NULL);
209
- $instance->setBar((${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->load(__DIR__.'/ getFooService.php')) && false ?: '_'}->foo() . (($this->hasParameter("foo")) ? ($this->getParameter("foo")) : ("default"))));
209
+ $instance->setBar((${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->load(' getFooService.php')) && false ?: '_'}->foo() . (($this->hasParameter("foo")) ? ($this->getParameter("foo")) : ("default"))));
210
210
211
211
return $instance;
212
212
@@ -243,7 +243,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
243
243
// Returns the public 'tagged_iterator' shared service.
244
244
245
245
return $this->services['tagged_iterator'] = new \Bar(new RewindableGenerator(function () {
246
- yield 0 => ${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->load(__DIR__.'/ getFooService.php')) && false ?: '_'};
246
+ yield 0 => ${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->load(' getFooService.php')) && false ?: '_'};
247
247
yield 1 => ${($_ = isset($this->services['tagged_iterator_foo']) ? $this->services['tagged_iterator_foo'] : $this->services['tagged_iterator_foo'] = new \Bar()) && false ?: '_'};
248
248
}, 2));
249
249
@@ -277,16 +277,18 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
277
277
class ProjectServiceContainer extends Container
278
278
{
279
279
private $buildParameters;
280
+ private $containerDir;
280
281
private $parameters;
281
282
private $targetDirs = array();
282
283
283
- public function __construct(array $buildParameters = array())
284
+ public function __construct(array $buildParameters = array(), $containerDir = __DIR__ )
284
285
{
285
- $dir = $this->targetDirs[0] = \dirname(__DIR__ );
286
+ $dir = $this->targetDirs[0] = \dirname($containerDir );
286
287
for ($i = 1; $i <= 5; ++$i) {
287
288
$this->targetDirs[$i] = $dir = \dirname($dir);
288
289
}
289
290
$this->buildParameters = $buildParameters;
291
+ $this->containerDir = $containerDir;
290
292
$this->parameters = $this->getDefaultParameters();
291
293
292
294
$this->services = array();
@@ -298,25 +300,25 @@ class ProjectServiceContainer extends Container
298
300
'foo_bar' => 'getFooBarService',
299
301
);
300
302
$this->fileMap = array(
301
- 'baz' => __DIR__.'/ getBazService.php',
302
- 'configured_service' => __DIR__.'/ getConfiguredServiceService.php',
303
- 'configured_service_simple' => __DIR__.'/ getConfiguredServiceSimpleService.php',
304
- 'decorator_service' => __DIR__.'/ getDecoratorServiceService.php',
305
- 'decorator_service_with_name' => __DIR__.'/ getDecoratorServiceWithNameService.php',
306
- 'deprecated_service' => __DIR__.'/ getDeprecatedServiceService.php',
307
- 'factory_service' => __DIR__.'/ getFactoryServiceService.php',
308
- 'factory_service_simple' => __DIR__.'/ getFactoryServiceSimpleService.php',
309
- 'factory_simple' => __DIR__.'/ getFactorySimpleService.php',
310
- 'foo' => __DIR__.'/ getFooService.php',
311
- 'foo.baz' => __DIR__.'/ getFoo_BazService.php',
312
- 'foo_with_inline' => __DIR__.'/ getFooWithInlineService.php',
313
- 'lazy_context' => __DIR__.'/ getLazyContextService.php',
314
- 'lazy_context_ignore_invalid_ref' => __DIR__.'/ getLazyContextIgnoreInvalidRefService.php',
315
- 'method_call1' => __DIR__.'/ getMethodCall1Service.php',
316
- 'new_factory_service' => __DIR__.'/ getNewFactoryServiceService.php',
317
- 'service_from_static_method' => __DIR__.'/ getServiceFromStaticMethodService.php',
318
- 'tagged_iterator' => __DIR__.'/ getTaggedIteratorService.php',
319
- 'tagged_iterator_foo' => __DIR__.'/ getTaggedIteratorFooService.php',
303
+ 'baz' => ' getBazService.php',
304
+ 'configured_service' => ' getConfiguredServiceService.php',
305
+ 'configured_service_simple' => ' getConfiguredServiceSimpleService.php',
306
+ 'decorator_service' => ' getDecoratorServiceService.php',
307
+ 'decorator_service_with_name' => ' getDecoratorServiceWithNameService.php',
308
+ 'deprecated_service' => ' getDeprecatedServiceService.php',
309
+ 'factory_service' => ' getFactoryServiceService.php',
310
+ 'factory_service_simple' => ' getFactoryServiceSimpleService.php',
311
+ 'factory_simple' => ' getFactorySimpleService.php',
312
+ 'foo' => ' getFooService.php',
313
+ 'foo.baz' => ' getFoo_BazService.php',
314
+ 'foo_with_inline' => ' getFooWithInlineService.php',
315
+ 'lazy_context' => ' getLazyContextService.php',
316
+ 'lazy_context_ignore_invalid_ref' => ' getLazyContextIgnoreInvalidRefService.php',
317
+ 'method_call1' => ' getMethodCall1Service.php',
318
+ 'new_factory_service' => ' getNewFactoryServiceService.php',
319
+ 'service_from_static_method' => ' getServiceFromStaticMethodService.php',
320
+ 'tagged_iterator' => ' getTaggedIteratorService.php',
321
+ 'tagged_iterator_foo' => ' getTaggedIteratorFooService.php',
320
322
);
321
323
$this->privates = array(
322
324
'factory_simple' => true,
@@ -331,7 +333,7 @@ class ProjectServiceContainer extends Container
331
333
332
334
public function getRemovedIds()
333
335
{
334
- return require __DIR__.'/ removed-ids.php';
336
+ return require $this->containerDir.\DIRECTORY_SEPARATOR.' removed-ids.php';
335
337
}
336
338
337
339
public function compile()
@@ -353,7 +355,7 @@ class ProjectServiceContainer extends Container
353
355
354
356
protected function load($file, $lazyLoad = true)
355
357
{
356
- return require $file;
358
+ return require $this->containerDir.\DIRECTORY_SEPARATOR.$ file;
357
359
}
358
360
359
361
/**
@@ -363,7 +365,7 @@ class ProjectServiceContainer extends Container
363
365
*/
364
366
protected function getBarService()
365
367
{
366
- $a = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->load(__DIR__.'/ getFoo_BazService.php')) && false ?: '_'};
368
+ $a = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->load(' getFoo_BazService.php')) && false ?: '_'};
367
369
368
370
$this->services['bar'] = $instance = new \Bar\FooClass('foo', $a, $this->getParameter('foo_bar'));
369
371
@@ -379,7 +381,7 @@ class ProjectServiceContainer extends Container
379
381
*/
380
382
protected function getFooBarService()
381
383
{
382
- return new \Bar\FooClass(${($_ = isset($this->services['deprecated_service']) ? $this->services['deprecated_service'] : $this->load(__DIR__.'/ getDeprecatedServiceService.php')) && false ?: '_'});
384
+ return new \Bar\FooClass(${($_ = isset($this->services['deprecated_service']) ? $this->services['deprecated_service'] : $this->load(' getDeprecatedServiceService.php')) && false ?: '_'});
383
385
}
384
386
385
387
public function getParameter($name)
@@ -502,6 +504,6 @@ return new \Container%s\ProjectServiceContainer(array(
502
504
'container.build_hash' => '%s',
503
505
'container.build_id' => '%s',
504
506
'container.build_time' => %d,
505
- ));
507
+ ), __DIR__.\DIRECTORY_SEPARATOR.'Container%s' );
506
508
507
509
)
0 commit comments