FOSElasticaBundle/Tests/bootstrap.php
2013-03-27 13:44:06 -04:00

19 lines
525 B
PHP

<?php
if (file_exists($file = __DIR__.'/../vendor/autoload.php')) {
$loader = require_once $file;
} else {
throw new RuntimeException('Install dependencies to run test suite.');
}
spl_autoload_register(function($class) {
if (0 === strpos($class, 'FOS\\ElasticaBundle\\')) {
$path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
if (!stream_resolve_include_path($path)) {
return false;
}
require_once $path;
return true;
}
});