1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace Symfony\Component\Routing\Loader;
- use Symfony\Component\Config\Loader\FileLoader;
- use Symfony\Component\Routing\RouteCollection;
- class GlobFileLoader extends FileLoader
- {
-
- public function load($resource, $type = null)
- {
- $collection = new RouteCollection();
- foreach ($this->glob($resource, false, $globResource) as $path => $info) {
- $collection->addCollection($this->import($path));
- }
- $collection->addResource($globResource);
- return $collection;
- }
-
- public function supports($resource, $type = null)
- {
- return 'glob' === $type;
- }
- }
|