4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Routing\Loader;
14 use Symfony\Component\Config\Loader\FileLoader;
15 use Symfony\Component\Routing\RouteCollection;
18 * GlobFileLoader loads files from a glob pattern.
20 * @author Nicolas Grekas <p@tchwork.com>
22 class GlobFileLoader extends FileLoader
27 public function load($resource, $type = null)
29 $collection = new RouteCollection();
31 foreach ($this->glob($resource, false, $globResource) as $path => $info) {
32 $collection->addCollection($this->import($path));
35 $collection->addResource($globResource);
43 public function supports($resource, $type = null)
45 return 'glob' === $type;