Chris@14: Chris@14: * Chris@14: * For the full copyright and license information, please view the LICENSE Chris@14: * file that was distributed with this source code. Chris@14: */ Chris@14: Chris@14: namespace Symfony\Component\DependencyInjection\Loader; Chris@14: Chris@14: /** Chris@14: * GlobFileLoader loads files from a glob pattern. Chris@14: * Chris@14: * @author Nicolas Grekas Chris@14: */ Chris@14: class GlobFileLoader extends FileLoader Chris@14: { Chris@14: /** Chris@14: * {@inheritdoc} Chris@14: */ Chris@14: public function load($resource, $type = null) Chris@14: { Chris@14: foreach ($this->glob($resource, false, $globResource) as $path => $info) { Chris@14: $this->import($path); Chris@14: } Chris@14: Chris@14: $this->container->addResource($globResource); Chris@14: } Chris@14: Chris@14: /** Chris@14: * {@inheritdoc} Chris@14: */ Chris@14: public function supports($resource, $type = null) Chris@14: { Chris@14: return 'glob' === $type; Chris@14: } Chris@14: }