Community

fatal error on Doctrine::loadModels('models');

Get help running lion|framework applications here.

fatal error on Doctrine::loadModels('models');

Postby mkingston on Wed Oct 14, 2009 4:19 pm

I'm using Doctrine with Lion and I'm getting a "Fatal error: Class 'BaseAcctgcalendars' not found in C:\wamp\www\models\Acctgcalendars.php".

Doctrine generated all the classes for the tables in my database. It creates all the base models in the /models folder, but also generates "Base..." classes in the /models/generated folder. The classes in the classes in the /models folder all extend the "Base..." classes in the /models/generated folder. Does anyone have an idea how a create a "path" for this /models/generated folder?. No one in the Doctrine community seems to have any idea.

Help!

Thanks,

Merrill
mkingston
 
Posts: 12
Joined: Sat Sep 05, 2009 9:22 pm

Re: fatal error on Doctrine::loadModels('models');

Postby james.demichele on Wed Oct 14, 2009 4:32 pm

Hey, Merrill.

It sounds like it's just an include path issue.

1) Are you making use of Doctrine's autoload functionality, and registering it with Lion? (I think you are, but just wanted to double check).

2) Are you registering this generated code in your includepath.xml with Lion? I'd double check that you have an entry there that points at all of these generated classes.

Code: Select all
http://www.lionframework.org/d.class-loader-1


If you've ensured that you have #2 setup correctly, it might be a caching issue. I'd also suggest clearing out your /var/code_c directory in your application.

Basically, it just sounds like neither the Lion autoloader or the Doctrine auto loader are seeing your classes. The most logical explanation would be to make sure your include path is setup to grab all of those classes in "C:\wamp\www\models\...".

Let me know if this doesn't help.

-Jamie
UPDATE: Also, please note that the paths you put into your application includepath.xml file are "relative" to your app directory, NOT absolute to the entire file system. You might need to put those generated classes into a application directories itself. Or, if they are shared between applications, you can add it to your root Lion "thirdparty" directory.
james.demichele
 
Posts: 19
Joined: Sun Jun 21, 2009 10:03 pm

Re: fatal error on Doctrine::loadModels('models');

Postby mkingston on Wed Oct 14, 2009 4:46 pm

James,

The problem is that I don't know enough about what I don't know yet. I've got the 1st one all set, thanks to Antonio, but I don't know how to know what the interface name is, so I can set up the path. I'm reading through the Lion docs information you sent me. Maybe that will help.

Thank you so much for all your help! It's a real bummer being such a newbie to all this.

Merrill
mkingston
 
Posts: 12
Joined: Sat Sep 05, 2009 9:22 pm

Re: fatal error on Doctrine::loadModels('models');

Postby mkingston on Wed Oct 14, 2009 6:03 pm

It was indeed a path issue. I first separated the "generated" folder from the models folder and added the following to the includepath.xml and it all started working correctly:

<!-- Base Model classes -->
<cluster name="Base" path="/generated/...">
<class name="*" file="*.class.php"/>
<interface name="*" file="*.php"/>
</cluster>

Thanks for pointing me in the right direction... I'm starting to catch on a little!

Thanks again,

Merrill
mkingston
 
Posts: 12
Joined: Sat Sep 05, 2009 9:22 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron