The beginning to ActiveSession.

This commit is contained in:
2009-08-19 21:31:13 +03:00
parent 89e4e7d77b
commit 89ad3e06d5
2 changed files with 44 additions and 5 deletions

View File

@@ -33,6 +33,37 @@
class ActiveSession {
public
# client user agent (OS, browser, etc.)
$user_agent = null,
# client's remote ip address
$ip = null,
# session id
$id = null,
# session key to store verification data in
$key = '____zynapse_secure_session_data_verification____',
# Session class has been started?
$started = false;
function __construct () {
if ( array_key_exists('sess_id', $_REQUEST) ) {
session_id($_REQUEST['sess_id']);
}
session_start();
$this->id = session_id();
}
function init () {
//TODO validate and init zynapse's session features
$this->started = true;
}
}
?>

View File

@@ -36,11 +36,12 @@ class Zynapse {
public static
# Action Classes
$env, // ActionEnvironment
$base, // ActionBase
$view, // ActionView
$log, // ActionLog
$locale; // ActiveLocale
$env, // ActionEnvironment
$base, // ActionBase
$view, // ActionView
$log, // ActionLog
$locale, // ActiveLocale
$session; // ActiveSession
function init () {
@@ -49,10 +50,17 @@ class Zynapse {
require_once(ZNAP_LIB_ROOT."/action_view.php");
require_once(ZNAP_LIB_ROOT."/active_session.php");
// enable php's session storage
self::$session = new ActiveSession();
// init core components
self::init_env();
self::init_base();
self::init_view();
// init zynapse's session system
self::$session->init();
echo "hello world<br />\n";
echo self::$env->environment."<br />\n<br />\n";
}