StubFilesystemLoader.php 732 B

1234567891011121314151617181920212223242526272829
  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. } else {
  16. class StubFilesystemLoader extends \Twig_Loader_Filesystem
  17. {
  18. protected function findTemplate($name)
  19. {
  20. // strip away bundle name
  21. $parts = explode(':', $name);
  22. return parent::findTemplate(end($parts));
  23. }
  24. }
  25. }