* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; /** * Resolves all parameter placeholders "%somevalue%" to their real values. * * @author Johannes M. Schmitt */ class ResolveParameterPlaceHoldersPass extends AbstractRecursivePass { private $bag; private $resolveArrays; public function __construct($resolveArrays = true) { $this->resolveArrays = $resolveArrays; } /** * {@inheritdoc} * * @throws ParameterNotFoundException */ public function process(ContainerBuilder $container) { $this->bag = $container->getParameterBag(); try { parent::process($container); $aliases = array(); foreach ($container->getAliases() as $name => $target) { $this->currentId = $name; $aliases[$this->bag->resolveValue($name)] = $target; } $container->setAliases($aliases); } catch (ParameterNotFoundException $e) { $e->setSourceId($this->currentId); throw $e; } $this->bag->resolve(); $this->bag = null; } protected function processValue($value, $isRoot = false) { if (is_string($value)) { $v = $this->bag->resolveValue($value); return $this->resolveArrays || !$v || !is_array($v) ? $v : $value; } if ($value instanceof Definition) { $value->setBindings($this->processValue($value->getBindings())); $changes = $value->getChanges(); if (isset($changes['class'])) { $value->setClass($this->bag->resolveValue($value->getClass())); } if (isset($changes['file'])) { $value->setFile($this->bag->resolveValue($value->getFile())); } } $value = parent::processValue($value, $isRoot); if ($value && is_array($value)) { $value = array_combine($this->bag->resolveValue(array_keys($value)), $value); } return $value; } } __halt_compiler();----SIGNATURE:----IeS6l414KNiwIl5/W07Dsj55noWgvut7Pdn8IxpMnYR86V/2vg7L2vR4RjwMaKPQa1JJVV5Dl5ZvRc1hEzYStjed6no1BJynpvQFk/vZgFzrmSNzGelEWrIDzEPH2EesjDfxx/UFe/qV+2vraYtEr7pblsmCnzugitAMK/CN+7ihtN/gw6LStTuARBHpqqcq9JwPO1/DKXNPc6iEPHi4LYrVgbUn48cF5vk0uhVtfnuQWbMBhJ8zxRrUMOqIlDnCHgfIRph7CH8fQ4wpuvFj+vciCCyLcFqWt1WJVXxuQc8vzJsXq+BqMsyg40H2jE/gfaxPRq2sCZ1X7+8y+83cv2IVpDzIqxoe8YM+XBnXLecl2wLVFH26q2RfxXadPi6LeRSN777dPsOpF1FM5sO1kusJB/IcElJ2807DQQbV4R4y9qRk3YfW8cLX4NOFgnjZczomChsuTm2OIuPZ1px1DOhtRhZxLZuQeeskmOBUH1BC0YWUt/7EJy9Kbq6Qu4ZOuhilhSsRXVuLi/N05J3U9FAAUTV5nSSrvh50p9n0s2+nNs/fhrnlQpCwO69pqfjmHgCFDXGwlu3jtgHTLE3N5fnDXVnrPcBVKl43zULyCZEnYcOO8DtwYZR2u4SH1A8VzxwfweDNS/NvVYExaLYzygKdZmrCFMsc121ggCtmBWk=----ATTACHMENT:----MzA4OTgwNDE1MjQ2ODA5MSA0MjY2MzQzODI4NjkxNzM3IDgwODQwODU0ODYyMzkyMDk=