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
30 * @param KernelInterface $kernel A KernelInterface instance
31 * @param null|string $path The path the global resource directory
32 * @param array $paths An array of paths where to look for resources
34 public function __construct(KernelInterface $kernel, $path = null, array $paths = array())
36 $this->kernel = $kernel;
42 parent::__construct($paths);
48 public function locate($file, $currentPath = null, $first = true)
50 if (isset($file[0]) && '@' === $file[0]) {
51 return $this->kernel->locateResource($file, $this->path, $first);
54 return parent::locate($file, $currentPath, $first);