
attractive, usable web applications
Richard's Blog - Design, coding and life in Japan
Doctrine autoload problem in version 1.2.1
Submitted by Richard on Tue, 03/16/2010 - 17:17I 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:
Recent Blog Posts
- Why you should use Rails 3 and not Django 5th Sep 10, 12:28
- Doctrine 2 and why you should use it! 29th Jul 10, 15:23
- How to localize your main blog listing page using Drupal 26th Jun 10, 11:46
- Creating Rails like template helpers in Django 24th Jun 10, 22:01
- Error: No module named messagesdjango.contrib.contenttypes 22nd Jun 10, 22:00
Post new comment