attractive, usable web applications


Richard's Blog - Design, coding and life in Japan

Richard

Doctrine autoload problem in version 1.2.1

I realized it was time to install doctrine into one of my legacy apps to bring it up to date and boost it some power somewhat. It seems that documentation was a bit lagging and I particularly had trouble with the autoloading of models.

Using the following in my bootstrap

spl_autoload_register(array('Doctrine', 'autoload')); spl_autoload_register(array('Doctrine', 'modelsAutoload'));

Helped me clear the following error

Fatal error: Class 'Model' not found in doctrine_test/test.php on line?

Then I needed to make sure I set autoloading to conservative to get rid of the

Fatal error: Class 'BaseModel'doctrine_test/models/model.php on line ?

error which I could easily do with

$manager->setAttribute(Doctrine_Core::ATTR_MODEL_LOADING, Doctrine_Core::MODEL_LOADING_CONSERVATIVE);

Tags:

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Recent Blog Posts