mirror of
https://github.com/jimeh/zynapse.git
synced 2026-02-19 07:06:39 +00:00
Restructured the component and session init processes.
This commit is contained in:
11
vendor/zynapse/active_session.php
vendored
11
vendor/zynapse/active_session.php
vendored
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
39
vendor/zynapse/zynapse.php
vendored
39
vendor/zynapse/zynapse.php
vendored
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user