diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-04 17:50:34 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-04 17:50:34 +0200 |
commit | 46b77928f746a4231d064774b5b67fd892c7ce86 (patch) | |
tree | e3ea690b3f0def1744ddae758923cf92171ef985 /vendor/symfony/routing/Symfony/Component/Routing/Loader/PhpFileLoader.php | |
parent | 68abd9c71b1d2f7bb2e9d21819584d1d15005b25 (diff) | |
download | wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.tar.gz wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.tar.zst wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.zip |
rm vendor
Diffstat (limited to 'vendor/symfony/routing/Symfony/Component/Routing/Loader/PhpFileLoader.php')
-rw-r--r-- | vendor/symfony/routing/Symfony/Component/Routing/Loader/PhpFileLoader.php | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/vendor/symfony/routing/Symfony/Component/Routing/Loader/PhpFileLoader.php b/vendor/symfony/routing/Symfony/Component/Routing/Loader/PhpFileLoader.php deleted file mode 100644 index 98b7efbf..00000000 --- a/vendor/symfony/routing/Symfony/Component/Routing/Loader/PhpFileLoader.php +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Routing\Loader; | ||
13 | |||
14 | use Symfony\Component\Config\Loader\FileLoader; | ||
15 | use Symfony\Component\Config\Resource\FileResource; | ||
16 | use Symfony\Component\Routing\RouteCollection; | ||
17 | |||
18 | /** | ||
19 | * PhpFileLoader loads routes from a PHP file. | ||
20 | * | ||
21 | * The file must return a RouteCollection instance. | ||
22 | * | ||
23 | * @author Fabien Potencier <fabien@symfony.com> | ||
24 | * | ||
25 | * @api | ||
26 | */ | ||
27 | class PhpFileLoader extends FileLoader | ||
28 | { | ||
29 | /** | ||
30 | * Loads a PHP file. | ||
31 | * | ||
32 | * @param string $file A PHP file path | ||
33 | * @param string|null $type The resource type | ||
34 | * | ||
35 | * @return RouteCollection A RouteCollection instance | ||
36 | * | ||
37 | * @api | ||
38 | */ | ||
39 | public function load($file, $type = null) | ||
40 | { | ||
41 | // the loader variable is exposed to the included file below | ||
42 | $loader = $this; | ||
43 | |||
44 | $path = $this->locator->locate($file); | ||
45 | $this->setCurrentDir(dirname($path)); | ||
46 | |||
47 | $collection = include $path; | ||
48 | $collection->addResource(new FileResource($path)); | ||
49 | |||
50 | return $collection; | ||
51 | } | ||
52 | |||
53 | /** | ||
54 | * {@inheritdoc} | ||
55 | * | ||
56 | * @api | ||
57 | */ | ||
58 | public function supports($resource, $type = null) | ||
59 | { | ||
60 | return is_string($resource) && 'php' === pathinfo($resource, PATHINFO_EXTENSION) && (!$type || 'php' === $type); | ||
61 | } | ||
62 | } | ||