从zend项目外部(在外部非Zend项目中)获取存储的Zend_Auth数据 [英] Get stored Zend_Auth data from outside the zend project (in an extern non-zend-project)

查看:83
本文介绍了从zend项目外部(在外部非Zend项目中)获取存储的Zend_Auth数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理Zend项目,我需要包括另一个未使用ZF的项目.该另一个项目存储在zend项目文件夹的公共目录中.

I'm working on a Zend project where I need to include another project, which isn't using ZF. This other project is stored in the public directory in the folder of the zend project.

对于另一个项目,我需要zend项目的logindata(为此使用zend auth).我认为有两种方法可以实现这一目标.

For this other project I need the logindata from the zend project (zend auth is used for this). There are 2 ways to accomplish this i think.

  1. 只需获取存储的登录会话变量. 但是哪里/什么变量?
  2. 或者尝试在另一个项目中使用zend方法获取数据. 但是如何?无需更改其他项目的结构.
  1. Just get the stored login sessionvariable. But where/what variable?
  2. Or try to get the data with zend methodes in the other project. But how? Without changing the structure of this other project.

或者(也许)还有其他/更好的解决方案?!

Or maybe (probably) there's an other/better solution?!

希望很清楚. Tnx

Hope it's clear. Tnx

推荐答案

$authNamespace = new Zend_Session_Namespace('Zend_Auth');
$authNamespace->user = "myusername";

只需include pathToZendProjectDirectory\Zend\Session.php来自您的"nonzend"项目

Just include pathToZendProjectDirectory\Zend\Session.php from your 'nonzend` project

这篇关于从zend项目外部(在外部非Zend项目中)获取存储的Zend_Auth数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆