Reputation: 662
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.
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.
Or maybe (probably) there's an other/better solution?!
Hope it's clear. Tnx
Upvotes: 0
Views: 1206
Reputation: 1
The login data is in SESSION variable. But we can't access the session data directly outside the project, because the SESSION contain some Zend objects. When we start the session it race an error __PHP_Incomplete_Class has no unserializer. To over come this add the code in starting of the page.
function __autoload($class) { // required files load automatically
require_once "pathToZendProjectDirectory/PathToZendLibrary/$class.php";
}
Upvotes: 0
Reputation: 3021
$authNamespace = new Zend_Session_Namespace('Zend_Auth');
$authNamespace->user = "myusername";
Just include pathToZendProjectDirectory\Zend\Session.php
from your 'nonzend` project
Upvotes: 1