Restructured the component and session init processes.

This commit is contained in:
2009-08-19 22:35:00 +03:00
parent 89ad3e06d5
commit 29e990dac3
2 changed files with 22 additions and 28 deletions

View File

@@ -45,22 +45,23 @@ class ActiveSession {
$id = null,
# session key to store verification data in
$key = '____zynapse_secure_session_data_verification____',
$key = '____active_session_verification_data____',
# Session class has been started?
$started = false;
function __construct () {
if ( array_key_exists('sess_id', $_REQUEST) ) {
session_id($_REQUEST['sess_id']);
}
}
function start () {
session_start();
$this->id = session_id();
}
function init () {
//TODO validate and init zynapse's session features
$this->id = session_id();
$this->started = true;
}

View File

@@ -50,36 +50,29 @@ class Zynapse {
require_once(ZNAP_LIB_ROOT."/action_view.php");
require_once(ZNAP_LIB_ROOT."/active_session.php");
// enable php's session storage
// Enable PHP sessions
ActiveSession::start();
// Init the environment system (ActionEnvironment)
self::$env = new ActionEnvironment();
self::$env->init();
// Init the session control system (ActiveSession)
self::$session = new ActiveSession();
// init core components
self::init_env();
self::init_base();
self::init_view();
// init zynapse's session system
self::$session->init();
// Init the core controller system (ActionBase)
self::$base = new ActionBase();
self::$base->init();
// Init the output and page rendering system (ActionView)
self::$view = new ActionView();
self::$view->init();
echo "hello world<br />\n";
echo self::$env->environment."<br />\n<br />\n";
}
function init_env () {
self::$env = new ActionEnvironment();
self::$env->init();
}
function init_base () {
self::$base = new ActionBase();
self::$base->init();
}
function init_view () {
self::$view = new ActionView();
self::$view->init();
}
}
?>