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\HttpKernel\Config;
14 use Symfony\Component\Config\FileLocator as BaseFileLocator;
15 use Symfony\Component\HttpKernel\KernelInterface;
18 * FileLocator uses the KernelInterface to locate resources in bundles.
20 * @author Fabien Potencier <fabien@symfony.com>
22 class FileLocator extends BaseFileLocator
28 * @param KernelInterface $kernel A KernelInterface instance
29 * @param string|null $path The path the global resource directory
30 * @param array $paths An array of paths where to look for resources
32 public function __construct(KernelInterface $kernel, $path = null, array $paths = array())
34 $this->kernel = $kernel;
40 parent::__construct($paths);
46 public function locate($file, $currentPath = null, $first = true)
48 if (isset($file[0]) && '@' === $file[0]) {
49 return $this->kernel->locateResource($file, $this->path, $first);
52 return parent::locate($file, $currentPath, $first);