mirror of
https://github.com/jimeh/zynapse.git
synced 2026-02-18 23:06:38 +00:00
The beginning to ActiveSession.
This commit is contained in:
31
vendor/zynapse/active_session.php
vendored
31
vendor/zynapse/active_session.php
vendored
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
18
vendor/zynapse/zynapse.php
vendored
18
vendor/zynapse/zynapse.php
vendored
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user