|
@@ 143-152 (lines=10) @@
|
| 140 |
|
private function configurePluginByName($name, Definition $definition, array $config) |
| 141 |
|
{ |
| 142 |
|
switch ($name) { |
| 143 |
|
case 'cache': |
| 144 |
|
// To preserve BC, we check the existence of the new plugin class and use it if available |
| 145 |
|
if (class_exists(CachePlugin::class)) { |
| 146 |
|
$definition->setClass(CachePlugin::class); |
| 147 |
|
} |
| 148 |
|
$definition |
| 149 |
|
->replaceArgument(0, new Reference($config['cache_pool'])) |
| 150 |
|
->replaceArgument(1, new Reference($config['stream_factory'])) |
| 151 |
|
->replaceArgument(2, $config['config']); |
| 152 |
|
break; |
| 153 |
|
case 'cookie': |
| 154 |
|
$definition->replaceArgument(0, new Reference($config['cookie_jar'])); |
| 155 |
|
break; |
|
@@ 162-171 (lines=10) @@
|
| 159 |
|
case 'history': |
| 160 |
|
$definition->replaceArgument(0, new Reference($config['journal'])); |
| 161 |
|
break; |
| 162 |
|
case 'logger': |
| 163 |
|
// To preserve BC, we check the existence of the new plugin class and use it if available |
| 164 |
|
if (class_exists(LoggerPlugin::class)) { |
| 165 |
|
$definition->setClass(LoggerPlugin::class); |
| 166 |
|
} |
| 167 |
|
$definition->replaceArgument(0, new Reference($config['logger'])); |
| 168 |
|
if (!empty($config['formatter'])) { |
| 169 |
|
$definition->replaceArgument(1, new Reference($config['formatter'])); |
| 170 |
|
} |
| 171 |
|
break; |
| 172 |
|
case 'redirect': |
| 173 |
|
$definition |
| 174 |
|
->addArgument($config['preserve_header']) |