Modify autoload for doctrine

This commit is contained in:
Nicolas Le Goff
2012-02-10 15:08:30 +01:00
parent ce1e7ecaac
commit d311bb8050
4 changed files with 13 additions and 6 deletions

View File

@@ -14,7 +14,6 @@ namespace Alchemy\Phrasea\Application;
require_once __DIR__ . "/../../../../lib/classes/API/OAuth2/Autoloader.class.php";
require_once __DIR__ . "/../../../../lib/bootstrap.php";
\bootstrap::register_autoloads();
\API_OAuth2_Autoloader::register();
use Symfony\Component\HttpFoundation\Response;

View File

@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Application;
require_once __DIR__ . "/../../../../lib/bootstrap.php";
require_once __DIR__ . "/../../../../lib/classes/API/OAuth2/Autoloader.class.php";
\bootstrap::register_autoloads();
\API_OAuth2_Autoloader::register();
use Symfony\Component\HttpFoundation\Response;

View File

@@ -421,6 +421,11 @@ class Core extends \Pimple
'Proxies' => realpath(__DIR__ . '/../../Doctrine/'),
'Doctrine\\Logger' => realpath(__DIR__ . '/../../'),
'Monolog' => realpath(__DIR__ . '/../../vendor/Silex/vendor/monolog/src'),
'Gedmo' => realpath(__DIR__ . '/../../vendor/doctrine2-gedmo/lib'),
'Events' => realpath(__DIR__ . '/../../Doctrine'),
'DoctrineExtensions' => realpath(__DIR__ . "/../../vendor/doctrine2-beberlei/lib"),
'Types' => realpath(__DIR__ . "/../../Doctrine"),
'PhraseaFixture' => realpath(__DIR__ . "/../../conf.d"),
));
$loader->register();

View File

@@ -15,8 +15,7 @@ use Alchemy\Phrasea\Core,
Alchemy\Phrasea\Core\Service,
Alchemy\Phrasea\Core\Service\ServiceAbstract,
Alchemy\Phrasea\Core\Service\ServiceInterface;
use Doctrine\DBAL\Types\Type,
Doctrine\Common\Cache\AbstractCache;
use Doctrine\DBAL\Types\Type;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
/**
@@ -52,8 +51,6 @@ class Doctrine extends ServiceAbstract implements ServiceInterface
{
parent::__construct($name, $options, $dependencies);
static::loadClasses();
if (empty($options))
{
throw new \Exception(sprintf(
@@ -245,6 +242,12 @@ class Doctrine extends ServiceAbstract implements ServiceInterface
, realpath(__DIR__ . '/../../../../../Doctrine')
);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader(
'Events'
, realpath(__DIR__ . '/../../../../../Doctrine')
);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader(
'Symfony'