<?php
umask(0000);

use Symfony\Component\ClassLoader\UniversalClassLoader;
// use Doctrine\Common\Annotations\AnnotationRegistry;
// use Composer\Autoload\ClassLoader;

$loader = new UniversalClassLoader();

$loader->registerNamespaces(array(
  'Symfony\Component' => __DIR__.'/../vendor/symfony/src',
  'Symfony'           => __DIR__.'/framework',
  'Sensio'            => array(__DIR__.'/src', __DIR__.'/vendor'),
  'Doctrine\\Bundle'  => __DIR__.'/../vendor/bundles',
  'Doctrine\\Common\DataFixtures' => __DIR__.'/../vendor/doctrine-fixtures/lib',
  'Doctrine\\Common'  => __DIR__.'/../vendor/doctrine-common/lib',
  'Doctrine\\DBAL'    => __DIR__.'/../vendor/doctrine-dbal/lib',
  'Doctrine'          => __DIR__.'/../vendor/doctrine/lib',
  'Monolog'           => __DIR__.'/../vendor/doctrine/src',

  'Gedmo' => __DIR__.'/../vendor/gedmo-doctrine-extensions/lib',
  'Stof'  => __DIR__.'/../vendor/bundles',
));

$loader->registerPrefixes(array(
  'Swift_' => __DIR__.'/Swift',
));

$loader->useIncludePath(true);
$loader->register();

// AnnotationRegistry::registerLoader(function($class) use ($loader) {
//   $loader->loadClass($class);
//   return class_exists($class, false);
// });

// AnnotationRegistry::registerFile(__DIR__.'/../vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');


return $loader;
