mirror of
https://github.com/jimeh/zynapse.git
synced 2026-02-18 23:06:38 +00:00
Restructed component init system again.
This commit is contained in:
7
vendor/zynapse/action_base.php
vendored
7
vendor/zynapse/action_base.php
vendored
@@ -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 () {
|
||||
|
||||
10
vendor/zynapse/action_environment.php
vendored
10
vendor/zynapse/action_environment.php
vendored
@@ -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 () {
|
||||
|
||||
14
vendor/zynapse/action_view.php
vendored
14
vendor/zynapse/action_view.php
vendored
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
7
vendor/zynapse/active_session.php
vendored
7
vendor/zynapse/active_session.php
vendored
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
36
vendor/zynapse/zynapse.php
vendored
36
vendor/zynapse/zynapse.php
vendored
@@ -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<br />\n";
|
||||
|
||||
Reference in New Issue
Block a user