2012-04-19 19:26:01 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// autoload.php generated by Composer
|
|
|
|
if (!class_exists('Composer\\Autoload\\ClassLoader', false)) {
|
|
|
|
require __DIR__.'/ClassLoader.php';
|
|
|
|
}
|
|
|
|
|
|
|
|
return call_user_func(function() {
|
|
|
|
$loader = new \Composer\Autoload\ClassLoader();
|
|
|
|
|
|
|
|
$map = require __DIR__.'/autoload_namespaces.php';
|
|
|
|
foreach ($map as $namespace => $path) {
|
|
|
|
$loader->add($namespace, $path);
|
|
|
|
}
|
|
|
|
|
|
|
|
$classMap = require __DIR__.'/autoload_classmap.php';
|
|
|
|
if ($classMap) {
|
|
|
|
$loader->addClassMap($classMap);
|
|
|
|
}
|
|
|
|
|
|
|
|
spl_autoload_register(function($class) {
|
2012-04-19 20:04:49 +00:00
|
|
|
$prefixes = array('Main\\Foo', 'Main\\Bar');
|
2012-04-19 19:26:01 +00:00
|
|
|
foreach ($prefixes as $prefix) {
|
|
|
|
if (0 !== strpos($class, $prefix)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$path = dirname(dirname(__DIR__)) . '/' . implode('/', array_slice(explode('\\', $class), 2)).'.php';
|
|
|
|
if (!stream_resolve_include_path($path)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
require_once $path;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$loader->register();
|
|
|
|
|
|
|
|
return $loader;
|
|
|
|
});
|