10 php doctrine zend-framework
我正在尝试设置Zend Framework和Doctrine.
之前有与ZF 1.8的讨论
该讨论没有考虑AutoLoader/Bootstrap系统.
如果我使用./zh.sh生成应用程序框架,我将如何整合Doctrine.
小智 6
找到了解决方案
http://pastie.org/481635 http://pastie.org/481633
在application/configs/application.ini中设置自动加载器和插件路径:
autoloadernamespaces.0 = "Doctrine"
pluginpaths.ZendX_Doctrine_Application_Resource= "ZendX/Doctrine/Application/Resource"
Run Code Online (Sandbox Code Playgroud)
在public/index.php中添加模型和生成模型的路径
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
realpath(APPLICATION_PATH . '/models'),
realpath(APPLICATION_PATH . '/models/generated'),
get_include_path(),
)));
Run Code Online (Sandbox Code Playgroud)
将http://pastie.org/481633保存到library/ZendX/Doctrine/Application/Resource/Doctrine.php