Add new driver to the chain

@param \FSi\Component\Metadata\Driver\DriverInterface $driver
@param string $namespace
@return \FSi\Component\Metadata\Driver\DriverChain
343126
public function addDriver(DriverInterface $driver, $namespace) {
        if (!isset($this->drivers[$namespace]))
            $this->drivers[$namespace] = array();
        $this->drivers[$namespace][] = $driver;
        return $this;
    }
960430
public function withNameSpace($namespace)
    {
        $namespace = (string) $namespace;

        if (! isset(static::$namespaces[$namespace])) {
            $new = clone $this;
            $new->setNamespace($namespace);
            $new->setEnabled($this->enabled);
            static::$namespaces[$namespace] = $new;
        }

        return static::$namespaces[$namespace];
    }
657256
public function addNamespace($namespace, $location)
	{
		$loader = $this->twig->getLoader();

		$loader->addPath($location, $namespace);

		foreach ($loader->getPaths() as $path) {
			if (is_dir($dir = $path.'/'.$namespace)) {
				$loader->prependPath($dir, $namespace);
			}
		}
	}
516162
public static function setCacheDriver(Cache $cache = null, $namespace = null)
    {
        self::setCache(self::$cacheDriver, $cache, $namespace);
    }
616785
public function getAliasNamespace(Driver $driver, $alias)
    {
        $manager = $this->managerFactory->getManager($driver);

        return $manager->getAliasNamespace($alias);
    }
1006335
final public function load($namespace, $resource)
    {
        $allowParent = !$this->defaults->getChanges() && empty($this->instanceof);

        return new PrototypeConfigurator($this, $this->loader, $this->defaults, $namespace, $resource, $allowParent);
    }
220231
private function buildDriver($name, array $driver)
    {
        return $this->drivers[$name] = new $driver['driver'](
            Arr::get($driver, 'options.'.$this->getDefaultOption(), [])
        );
    }
822957
protected function createDriver($driver): Contracts\Factory
    {
        if (\is_null($this->setupDriverConfig($driver))) {
            throw new InvalidArgumentException("Driver [$driver] not supported.");
        }

        return new $this->resolver($this->app, $this, $driver);
    }
126944
public function createDriver($options = [])
    {
        $options = $this->optionsResolver->resolve($options);

        return new CollectionDriver($this->extensions, $options['collection'], $options['criteria']);
    }
195166
public function setDriver($driver)
    {
        $class = $this->wei->getClass($driver);

        if (!class_exists($class)) {
            throw new \InvalidArgumentException(sprintf('Cache driver class "%s" not found', $class));
        }

        if (!is_subclass_of($class, 'Wei\BaseCache')) {
            throw new \InvalidArgumentException(sprintf('Cache driver class "%s" must extend "Wei\BaseCache"', $class));
        }

        $this->driver = $driver;
        $this->object = $this->wei->get($driver);
        return $this;
    }
811309
public function driver($driver = null)
    {
        $shortener = $this->app['config']['shortener'];

        $driver = $driver ?: $shortener['default'];

        $driverMethod = 'create'.ucfirst($driver).'Driver';

        if (method_exists($this, $driverMethod)) {
            return $this->{$driverMethod}($shortener);
        }

        throw new InvalidArgumentException("Driver [{$driver}] is not supported.");
    }
1066401
public function addDriver(string $name, DriverInterface $driver): DatabaseManager
    {
        if (isset($this->drivers[$name])) {
            throw new DBALException("Connection '{$name}' already exists");
        }

        $this->drivers[$name] = $driver;

        return $this;
    }
367000
public function addNamespace($namespace, $priority = PriorityQueue::NORMAL)
    {
        $namespace = static::normalise($namespace);

        $this->namespaces->insert($namespace, $priority);

        return $this;
    }
366750
public static function addPath ($path, $namespace = \Twig_Loader_Filesystem::MAIN_NAMESPACE)
    {
        $twigLoader = self::getTwigLoader();
        /* @var $twigLoader \Twig_Loader_Filesystem */
        $twigLoader->addPath($path, $namespace);
    }
124065
public static function create(string $driver) : Backend
    {
        if (strpos($driver, '\\') === false) {
            $class = __NAMESPACE__ . '\\Drivers\\' . studly_case($driver);
        } else {
            $class = $driver;
        }

        if (!class_exists($class)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Class `%s` does not exist, so it\'s far from being a good settings backend candidate',
                    $class
                )
            );
        }

        return app()->make($class);
    }
879828
public static function registerAll(MappingDriverChain $driverChain)
    {
        self::register($driverChain, array_merge(self::$abstract, self::$concrete));
    }
372608
public function setConfiguration(DriverInterface $driver)
    {
        $this->_configuration = $driver;
        $this->_namespace = null;
        $this->_action = null;
        $this->_controller = null;
        return $this;
    }