如何结合 Zend_Session 和 Zend_Oauth

发布于 2024-10-21 00:33:56 字数 1590 浏览 1 评论 0原文

我在使用 Zend_Auth 和 Zend_Session 时遇到问题。我最近将引导程序文件分解为模块化引导程序。从那时起,每当我使用 Zend_Auth 登录时,我都会收到一条错误消息,表明会话已启动。所以我将 Zend_Auth 命名空间更改为“DC_Auth”。现在我遇到了一些错误。

Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'Zend_Session::start() - /home/digitalcivilian.com/subdomains/dev/app/library/Zend/Loader.php(Line:146): Error #2 include_once(): Failed opening 'Application/Proxies/User/Model/ProfileProxy.php' for inclusion (include_path='/home/digitalcivilian.com/subdomains/dev/app/application/../library:/home/digitalcivilian.com/subdomains/dev/app/library:.:/usr/share/pear:/usr/share/php') Array' in /home/digitalcivilian.com/subdomains/dev/app/library/Zend/Session.php:493 Stack trace: #0 /home/digitalcivilian.com/subdomains/dev/app/library/Zend/Session/Namespace.php(143): Zend_Session::start(true) #1 /home/digitalcivilian.com/subdomains/dev/app/library/Zend/Auth/Storage/Session.php(87): Zend_Session_Namespace->__construct('DC_Auth') #2 /home/digitalcivilian.com/subdomains/dev/app/application/Bootstrap.php(222): Zend_Auth_Storage_Session->__construct('DC_Auth') #3 /home/digitalcivilian.com/subdomains/dev/app/library/Zend/Application/Bootstrap/BootstrapAbstract.php(66 in /home/digitalcivilian.com/subdomains/dev/app/library/Zend/Session.php on line 493 

它找不到的代理文件(对于原则 2)实际上位于 application/proxies/User_Model_ProfileProxy.php。

如果您需要更多信息,请告诉我,我在这方面度过了一段愉快的时光。

编辑:额外说明,我可以通过在index.php 中运行引导程序之前放置 Zend_Session::start() 来停止 zend 会话问题。但是,如果我这样做,会话会在加载用户模块对象之前启动,因此 Zend_Auth 身份最终会成为 PHP_Incomplete_Object。

谢谢

I'm having a problem with Zend_Auth and Zend_Session. I recently broke my bootstrap file down into modular bootstraps. Since then, whenever I login using Zend_Auth I get an error that the session has already been started. So I changed my Zend_Auth namespace to 'DC_Auth'. Now I'm getting a couple of errors.

Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'Zend_Session::start() - /home/digitalcivilian.com/subdomains/dev/app/library/Zend/Loader.php(Line:146): Error #2 include_once(): Failed opening 'Application/Proxies/User/Model/ProfileProxy.php' for inclusion (include_path='/home/digitalcivilian.com/subdomains/dev/app/application/../library:/home/digitalcivilian.com/subdomains/dev/app/library:.:/usr/share/pear:/usr/share/php') Array' in /home/digitalcivilian.com/subdomains/dev/app/library/Zend/Session.php:493 Stack trace: #0 /home/digitalcivilian.com/subdomains/dev/app/library/Zend/Session/Namespace.php(143): Zend_Session::start(true) #1 /home/digitalcivilian.com/subdomains/dev/app/library/Zend/Auth/Storage/Session.php(87): Zend_Session_Namespace->__construct('DC_Auth') #2 /home/digitalcivilian.com/subdomains/dev/app/application/Bootstrap.php(222): Zend_Auth_Storage_Session->__construct('DC_Auth') #3 /home/digitalcivilian.com/subdomains/dev/app/library/Zend/Application/Bootstrap/BootstrapAbstract.php(66 in /home/digitalcivilian.com/subdomains/dev/app/library/Zend/Session.php on line 493 

The Proxy file (for Doctrine 2) that it can't find is actually at application/proxies/User_Model_ProfileProxy.php.

If you need anymore information please let me know, I've been having a hell of a time with this.

Edit: An extra note, I can stop the zend session problems by putting Zend_Session::start() before I run my bootstrap in index.php. But if I do that the session is started before my User module objects are loaded so the Zend_Auth identity ends up being a PHP_Incomplete_Object.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

疏忽 2024-10-28 00:33:56

我想通了。我有一个 ACL 助手来处理访问控制。我在加载用户模块之前添加了该助手。这导致了很多事情的问题。我将该帮助程序初始化移至用户模块的末尾,然后就可以开始了。

I figured it out. I had an ACL helper to work with dealing with access control. I was adding that helper before loading the User module. Which was causing issues with multiple things. I moved that helper initialization to the end of the user module and I'm good to go.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文