UserScape / doctrine-bundle

Doctrine ORM bundle for the Laravel framework.
GNU Lesser General Public License v2.1
6 stars 1 forks source link

Fatal error: Class 'Event' not found #2

Open wildlyinaccurate opened 12 years ago

wildlyinaccurate commented 12 years ago

When I ran the CLI, I was receiving this error. Adding Laravel\Event to the use statement in doctrine/start.php seemed to fix it, but I wasn't sure whether this is a bug with the bundle or bad installation/setup on my part?

wildlyinaccurate commented 12 years ago

I think this might be a problem with my installation, or environment (Windows). I'm now getting an uncaught exception Database connection is not defined for []. - after a bit of digging I've found that application/config/database.php isn't loaded when I run the Doctrine CLI, which explains the exception.

Edit: Just booted into my Debian box and got the same result. Any advice?

Edit 2: Fixed the issue by adding the same configuration loader as in application/start.php, i.e.

Laravel\Event::listen(Laravel\Config::loader, function($bundle, $file)
{
    return Laravel\Config::file($bundle, $file);
});

-- Is that really necessary?

joericochuyt commented 12 years ago

I'm testing laravel and doctrine on ubuntu 10.04 and had the same issues

wildlyinaccurate commented 12 years ago

@joericochuyt See if my branch works for you - https://github.com/wildlyinaccurate/doctrine-bundle

joericochuyt commented 12 years ago

works perfect, tnx for the work

wildlyinaccurate commented 12 years ago

No problem. @taylorotwell I'll submit a pull request with my fixes later this week.