registerNamespaces(array( 'Symfony' => array($vendorDir.'/symfony/src'), 'Knp' => array($vendorDir.'/knpmenu/src'), )); $loader->registerPrefixes(array( 'Twig_' => $vendorDir.'/twig/lib', )); $loader->register(); spl_autoload_register(function($class) { if (0 === strpos($class, 'Sonata\\AdminBundle\\')) { $path = __DIR__.'/../../'.implode('/', array_slice(explode('\\', $class), 2)).'.php'; if (!stream_resolve_include_path($path)) { return false; } require_once $path; return true; } }); }