* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Routing\Loader; use Symfony\Component\Config\Loader\FileLoader; use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; use Symfony\Component\Routing\RouteCollection; /** * PhpFileLoader loads routes from a PHP file. * * The file must return a RouteCollection instance. * * @author Fabien Potencier */ class PhpFileLoader extends FileLoader { /** * Loads a PHP file. * * @param string $file A PHP file path * @param string|null $type The resource type * * @return RouteCollection A RouteCollection instance */ public function load($file, $type = null) { $path = $this->locator->locate($file); $this->setCurrentDir(dirname($path)); // the closure forbids access to the private scope in the included file $loader = $this; $load = \Closure::bind(function ($file) use ($loader) { return include $file; }, null, ProtectedPhpFileLoader::class); $result = $load($path); if ($result instanceof \Closure) { $collection = new RouteCollection(); $result(new RoutingConfigurator($collection, $this, $path, $file), $this); } else { $collection = $result; } $collection->addResource(new FileResource($path)); return $collection; } /** * {@inheritdoc} */ public function supports($resource, $type = null) { return is_string($resource) && 'php' === pathinfo($resource, PATHINFO_EXTENSION) && (!$type || 'php' === $type); } } /** * @internal */ final class ProtectedPhpFileLoader extends PhpFileLoader { } __halt_compiler();----SIGNATURE:----FwmZbtOVCJooFL+k1Ktoew1x8AYcMa6PfCuN5g1yzw26d8sPG2OjfZHu4NgVTNeQdB7i6LGqYGpG+56+3KaE5X2O/jYIGpv1raLrPayrOAv3PLfuRWSw9GijUFGD/ceUHvRlJPkSEio89gxL9fB6XBHmZSV/NJax28T9bJy8PziWe6ARnWXqLTG1to9ZZ1fgqASRYbFaKRFQytrOrfnyZMa1yy1M11U13Pa1RYl4EQ6FM+uZkoJEdYFZtPvj0KIlADprMZi1aihrP898YzocnWSu9ocvK7fwB+80lFbVBoUgasiWxHBfa3qhLRS8M4h5iseyJnyWUwVAChV7So8Nxz58hevjC2kVtowTInXWfJKRCNjCU66z5QuXJn78pjTcpW2KX4XOKtET/SZD2oV/2RdVWrJyM2ghq/+G8CnigVdyGrtoY4qo1pWN0/sAIExIvLcUbR5odyOKdHDPkcvWD0lgqk9qtbv1ZkpXGopRqho+UQD/OK7TwV4dhIKfhV10MvFfmYy58p6Iq+rQDq8LXPbPnqK3Hgy7eIh3r+Ic9kO7RIbKdJBWFdsyoIjInmheRdli2kib8AL//r01ULk69NLFiF6FEAvCrdrD64tgh94WluKw1TL5QHgfnTyLxgLoSQamMC08k4BQJzYH2Dsw1vm7D8/hqfNILxAKIFJCYEM=----ATTACHMENT:----NjYwODU3NDI5NjA4MTM2MSAxOTIwNzc5Njc3Mzk2NjE3IDY4ODIyMzc4MDQzNTk1MDk=