bootstrap.php 979 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /*
  3. * This file is part of the Metadata library.
  4. *
  5. * (C) 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
  6. *
  7. */
  8. spl_autoload_register(function($class) {
  9. if (0 === strpos($class, 'Metadata\Tests\\')) {
  10. $path = __DIR__.'/../tests/'.strtr($class, '\\', '/').'.php';
  11. if (file_exists($path) && is_readable($path)) {
  12. require_once $path;
  13. return true;
  14. }
  15. } elseif (0 === strpos($class, 'Metadata\\')) {
  16. $path = __DIR__.'/../src/'.($class = strtr($class, '\\', '/')).'.php';
  17. if (file_exists($path) && is_readable($path)) {
  18. require_once $path;
  19. return true;
  20. }
  21. } elseif (0 === strpos($class, 'Symfony\\')) {
  22. $path = __DIR__.'/../../symfony/src/'.strtr($class, '\\', '/').'.php';
  23. if (file_exists($path) && is_readable($path)) {
  24. require_once $path;
  25. return true;
  26. }
  27. }
  28. });
  29. @include __DIR__ . '/../vendor/autoload.php';