* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\Component\DependencyInjection\Argument\IteratorArgument; use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use Symfony\Component\ExpressionLanguage\Expression; /** * @author Nicolas Grekas */ class ContainerConfigurator extends AbstractConfigurator { const FACTORY = 'container'; private $container; private $loader; private $instanceof; private $path; private $file; public function __construct(ContainerBuilder $container, PhpFileLoader $loader, array &$instanceof, $path, $file) { $this->container = $container; $this->loader = $loader; $this->instanceof = &$instanceof; $this->path = $path; $this->file = $file; } final public function extension($namespace, array $config) { if (!$this->container->hasExtension($namespace)) { $extensions = array_filter(array_map(function ($ext) { return $ext->getAlias(); }, $this->container->getExtensions())); throw new InvalidArgumentException(sprintf( 'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s', $namespace, $this->file, $namespace, $extensions ? sprintf('"%s"', implode('", "', $extensions)) : 'none' )); } $this->container->loadFromExtension($namespace, static::processValue($config)); } final public function import($resource, $type = null, $ignoreErrors = false) { $this->loader->setCurrentDir(dirname($this->path)); $this->loader->import($resource, $type, $ignoreErrors, $this->file); } /** * @return ParametersConfigurator */ final public function parameters() { return new ParametersConfigurator($this->container); } /** * @return ServicesConfigurator */ final public function services() { return new ServicesConfigurator($this->container, $this->loader, $this->instanceof); } } /** * Creates a service reference. * * @param string $id * * @return ReferenceConfigurator */ function ref($id) { return new ReferenceConfigurator($id); } /** * Creates an inline service. * * @param string|null $class * * @return InlineServiceConfigurator */ function inline($class = null) { return new InlineServiceConfigurator(new Definition($class)); } /** * Creates a lazy iterator. * * @param ReferenceConfigurator[] $values * * @return IteratorArgument */ function iterator(array $values) { return new IteratorArgument(AbstractConfigurator::processValue($values, true)); } /** * Creates a lazy iterator by tag name. * * @param string $tag * * @return TaggedIteratorArgument */ function tagged($tag) { return new TaggedIteratorArgument($tag); } /** * Creates an expression. * * @param string $expression an expression * * @return Expression */ function expr($expression) { return new Expression($expression); } __halt_compiler();----SIGNATURE:----wsb68+gsuQm926Lhqr9F8CNS6AfcMcAB24s09wF93nynmlWdVdUwZss+StlXPoL2X2DwmZL8+FoB8z1saz9wss8jpNRmsvX1aAPJfeQFxMutEVNQSdASlx3i+VPszqPm12jcPjsybiJ7AooY3oscMwKZx/vPstStc0g7Ji77b319U0t5kNNYnnUU9880QDMwlCEt0EiLrt6ezI58217f88RVQc5ss/OQfkhr5Wx+rn0vBySqFUjLfr/pt4o7uUmcMzYpUTlmMmv56QZY3s/kfcs1Rf9r0S05VQnXE8e+blxFHtyAV7KLjE5W5mNhyA/IT1vgfEFgd5D9gWG19qAllUwyFYcgwRNLNi6dM0fmdZHp585gPAKil0oDtDElD/bGsY5u8T+melmr9WgTBsONjxcRkJgOnHpTj/CAGhd57m0PU+ptREA58MvSFGr/4X2UwI2pLFJHBMOb7BIs/yRpaT1fauuc1DfsZ4H1zIB9DgiCZZ6NIJH8S4RN+iREm5fbRe70xc6FP83hs9F3jqy46GAi8110nQ5Js9yqmh+IOoxz097jcUqN+I9zxU0EW9sLkXn08IyoM7fkdR8GOGu0dpdXkjnmdhATf3Szfbilf+tuiUaAAKKirE8I9zG3I7+2k8Jk3rJRYeMO5PjWMQbXmwbKBQ0UmZo0XhT4JNXPdlc=----ATTACHMENT:----NjU0NTE5MTIwODgxNDgxOSAyMjU0NDcyMzU0MTQwMDc4IDQ4NDcwNjA4MTY3NjI3MjU=