StubFilesystemLoader.php 736 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Tests\Bridge\Twig\Extension\Fixtures;
  11. // Preventing autoloader throwing E_FATAL when Twig is now available
  12. if (!class_exists('Twig_Environment')) {
  13. class StubFilesystemLoader
  14. {
  15. }
  16. } else {
  17. class StubFilesystemLoader extends \Twig_Loader_Filesystem
  18. {
  19. protected function findTemplate($name)
  20. {
  21. // strip away bundle name
  22. $parts = explode(':', $name);
  23. return parent::findTemplate(end($parts));
  24. }
  25. }
  26. }