
front and back-end web development, Leeds, UK
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
- Testing controllers in Lithium 2nd Feb 12, 18:19
- Practical Internationalization in Lithium 31st Dec 11, 02:06
- Using OAuth in Lithium 30th Dec 11, 23:47
- How to add your own Tokens from CCK fields in Druapl 7 17th Jun 11, 04:49
- Weaving Lithium #li3 into a legacy PHP application incrementally 5th Oct 10, 11:54