diff --git a/vendor/zynapse/action_base.php b/vendor/zynapse/action_base.php index bb096f6..ce806cd 100644 --- a/vendor/zynapse/action_base.php +++ b/vendor/zynapse/action_base.php @@ -40,6 +40,7 @@ class ActionBase { $view, // ActionView $log, // ActiveLog $locale, // ActiveLocale + $session, // ActiveSession # Paths $apps_path, @@ -48,7 +49,10 @@ class ActionBase { $public_path, $tmp_path, $cache_path, - $script_path; + $script_path, + + # Misc. + $started = false; function __construct () { @@ -72,6 +76,7 @@ class ActionBase { function init () { $this->set_paths(); + $this->started = true; } function set_paths () { diff --git a/vendor/zynapse/action_environment.php b/vendor/zynapse/action_environment.php index 91fcb82..bb9c6e9 100644 --- a/vendor/zynapse/action_environment.php +++ b/vendor/zynapse/action_environment.php @@ -41,11 +41,14 @@ class ActionEnvironment { $root, # Components - $session, + $session, // ActiveSession + + # System + $is_windows, + $path_separator, # Misc. - $is_windows, - $path_separator; + $started = false; function __construct () { @@ -55,6 +58,7 @@ class ActionEnvironment { function init () { $this->set_include_paths(); $this->load_environment_file(); + $this->started = true; } function __wakeup () { diff --git a/vendor/zynapse/action_view.php b/vendor/zynapse/action_view.php index 82cd273..4187518 100644 --- a/vendor/zynapse/action_view.php +++ b/vendor/zynapse/action_view.php @@ -33,12 +33,26 @@ class ActionView { + public + + # Components + $env, // ActionEnvironment + $base, // ActionBase + $log, // ActiveLog + $locale, // ActiveLocale + $session, // ActiveSession + + # Misc. + $started = false; + + function __construct () { } function init () { + $this->started = true; } } diff --git a/vendor/zynapse/active_session.php b/vendor/zynapse/active_session.php index e43fc71..500d72d 100644 --- a/vendor/zynapse/active_session.php +++ b/vendor/zynapse/active_session.php @@ -87,14 +87,11 @@ class ActiveSession { } - function start () { - session_start(); - } - function init () { - $this->ini_setup(); // TODO get rid of the session settings, they don't seem to work + $this->ini_setup(); $this->validate(); $this->id = session_id(); + session_start(); $this->started = true; } diff --git a/vendor/zynapse/zynapse.php b/vendor/zynapse/zynapse.php index eaca7c7..31d8b0d 100644 --- a/vendor/zynapse/zynapse.php +++ b/vendor/zynapse/zynapse.php @@ -50,24 +50,38 @@ class Zynapse { require_once(ZNAP_LIB_ROOT."/action_view.php"); require_once(ZNAP_LIB_ROOT."/active_session.php"); - // Enable PHP sessions - ActiveSession::start(); - - // Init the session control system (ActiveSession) + # Create component objects self::$session = new ActiveSession(); - self::$session->init(); - - // Init the environment system (ActionEnvironment) self::$env = new ActionEnvironment(); + self::$base = new ActionBase(); + self::$view = new ActionView(); + + # Assign internal component references self::$env->session =& self::$session; + + self::$base->env =& self::$env; + self::$base->view =& self::$view; + // self::$base->log =& self::$log; //TODO Create ActionLog class + self::$base->locale =& self::$locale; + self::$base->session =& self::$session; + + self::$view->env =& self::$env; + self::$view->base =& self::$base; + // self::$view->log =& self::$log; //TODO Create ActionLog class + self::$view->locale =& self::$locale; + self::$view->session =& self::$session; + + + # Init the environment system (ActionEnvironment) self::$env->init(); - // Init the core controller system (ActionBase) - self::$base = new ActionBase(); + # Init the session control system (ActiveSession) + self::$session->init(); + + # Init the core controller system (ActionBase) self::$base->init(); - // Init the output and page rendering system (ActionView) - self::$view = new ActionView(); + # Init the output and page rendering system (ActionView) self::$view->init(); echo "hello world
\n";