-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathautoload.php.dist
More file actions
30 lines (25 loc) · 1000 Bytes
/
autoload.php.dist
File metadata and controls
30 lines (25 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
$vendorDir = __DIR__.'/vendor';
require_once $vendorDir.'/symfony/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
'Symfony\\Tests' => $vendorDir.'/symfony/symfony/tests',
'Symfony' => array($vendorDir.'/symfony/symfony/src'),
'Doctrine\\Common' => array($vendorDir.'/doctrine/common/lib'),
'Doctrine\\ORM' => array($vendorDir.'/doctrine/orm/lib'),
));
$loader->registerPrefixes(array(
'Twig_' => $vendorDir.'/twig/twig/lib',
));
$loader->register();
spl_autoload_register(function($class) {
if (0 === strpos($class, 'Snowcap\\CoreBundle\\')) {
$path = __DIR__.'/'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
if (!stream_resolve_include_path($path)) {
return false;
}
require_once $path;
return true;
}
});